Skip to content

Instantly share code, notes, and snippets.

@yaxinlx
yaxinlx / go2-error-handling.md
Last active September 24, 2019 12:35
A Go 2 error handling propsoal

Use ? as suffixes of multi-value tuples to remove the last error value from multi-value tuples

This proposal is against the handle part of Go 2 error handling draft design, and use a new syntax to replace the check syntax in Go 2 error handling draft design.

I think Go 2 error handling draft design does too much. It makes many considerations for many rare cases. However, what we need is just to avoid many if err != nil {return ..., err} boilerplates.

The syntax