Skip to content

Instantly share code, notes, and snippets.

go2-error-handling-proposal

I propose try-return statements.

Syntax

"try" IdentifierList ( ":=" | "=" ) ExpressionList "return" ExpressionList

e.g. try a, err := foo() return err