Re:Why Go's Error Handling Is Awesome
by corty on Tuesday July 07, 2020 @09:10AM
(#23758821)
You don't, at least not usually.
func foo()(value,err) can return any combination of valid or invalid value and error, so (nil, nil) would be possible, or ("valid value", someerror). It is just by convention that you shouldn't do that.
func foo()(value,err) can return any combination of valid or invalid value and error, so (nil, nil) would be possible, or ("valid value", someerror). It is just by convention that you shouldn't do that.