4 ms·
Go errors are a convention. Nothing forces you to use error interface to do anything nor handle anything either. See my comment here: https://news.ycombinator
by throw_m239339 6y ago
Go errors are a convention. Nothing forces you to use error interface to do anything nor handle anything either.
See my comment here:
https://news.ycombinator.com/item?id=23759196 https://news.ycombinator.com/item?id=23759196
> You can attach additional data to an error, and in recent versions of go you can wrap errors in other errors.
Yes, with a function added to the std lib after people used a 3rd party lib for years to do the same thing. Nothing to do with a change of language structure or features.