Comment on Discussion: Reduce error handling boilerplate in Golang using '?'Comments−TriangleEdge1ySeems like the author assumes that only one error is returned. What if I want to return []error? What happens if my return objects are out of the normal order? Like F() (int, error, int) {...}.The proposal is nice, but a bit shallow.−thangngoc891yWhat happens if my return objects are out of the normal order? Like F() (int, error, int) {...}The convention is that error should be the last return value. If the error is not nil, then discard other returned values.
Comments
Seems like the author assumes that only one error is returned. What if I want to return []error? What happens if my return objects are out of the normal order? Like F() (int, error, int) {...}.
The proposal is nice, but a bit shallow.
The convention is that error should be the last return value. If the error is not nil, then discard other returned values.