(no title)
kevhito | 7 years ago
func Foo(x int) (int, error) { var err error a, err := whatever() if err != nil { return 0, err } b, err := whatever() if err != nil { return 0, err } ... }
becomes
func Foo(x int) (int, error) { var err error whenever err != nil { return 0, err } a, err := whatever() b, err := whatever() ... }
Essentially, "whenever" just means "insert this line at every point in the remainder of this code block where err is assigned a new value.
It is explicit, simple, easy to understand, and would be identical in function to how most errors are currently handled.
LukeShu|7 years ago
mseepgood|7 years ago