Hacker News new | ask | show | jobs
by samfisher83 2830 days ago
Does go not have exception handling?
2 comments

Go does not have exception handling at all. It is a proposal they're seriously considering for go2:

https://go.googlesource.com/proposal/+/master/design/go2draf...

See the bits about error handling and error values.

What was the reason the go designers didn't have exception handling?
Read Rob Pike's post on why: https://commandcenter.blogspot.com/2012/06/less-is-exponenti...

The go2 proposal shows that in this respect, he was woefully wrong.

go has something in the same general area of error handling called panic/recover. It's not exceptions in the normal sense, and devs expect nothing should panic across api boundaries.