Technically, the language does support exceptions. That said, they're in the "please never use this, ever."
/pedant hat off
The spirit of your comment is right, however -- the wonky code resulting from error handling, just like the "compile error on unused vars or imports," is something most new Go users find jarring.
> Technically, the language does support exceptions. That said, they're in the "please never use this, ever."
No, its not. The convention is that any use of panics within libraries should be internal, and that libraries' exposed interfaces should use error returns. [1] Use of panics internal to libraries, or use of panics within application code that is not creating a library for others to consume, is not discouraged.
Technically, the language does support exceptions. That said, they're in the "please never use this, ever."
/pedant hat off
The spirit of your comment is right, however -- the wonky code resulting from error handling, just like the "compile error on unused vars or imports," is something most new Go users find jarring.