3 ms·
> so the error value is clearly visible in function signature and must at least be explicitly ignored by the caller Not exactly. There's nothing requiring you
by Capricorn2481 2y ago
> so the error value is clearly visible in function signature and must at least be explicitly ignored by the caller
Not exactly. There's nothing requiring you to handle errors. But Go doesn't let you have unused values in general.
So in a transaction commit function, if you forget that it returns an error, Go will just let you ignore it. This is a big issue with treating errors as values. https://github.com/golang/go/issues/20803 https://github.com/golang/go/issues/20803