Open
Description
I propose introducing a new keyword try
to tackle the problem of if err !=nil
spam.
Curretnly we have
func foo() error {
f, err := openFile()
if err != nil {
.....
}
n, err := operateOnFile(f)
if err != nil {
.....
}
}
This can quickly get out of hand.
I propose the code to look something like
func foo() error {
f := try openFile()
n := try operateOnFile(f)
}
The way it will work is, try
will be replaced by the normal error handling we have now, during preprocessing.
Many details are to be defined. This is just a conversation starter.