News for hackers. Stuff that matters.
Re:Go Subtleties You May Not Know by ignoramous on Wednesday October 22, 2025 @06:21AM (#45667034)
> And exception handling

If you write Go regularly, the rather verbose error handling simply fades into the background.

That said, errors in Go don't really translate to Exceptions as generally thought of; panic, however; may be does.

Making changes to error handling wasn't for the lack of trying, though: https://news.ycombinator.com/item?id=44171677

> issue with nil pointers

This is why most APIs strive for a non-nil zero value, where possible, as methods (on structs) can still dictate if it will act on a pointer. Though, I get what you're saying with Go missing Optional / Maybe / ? operator, the only other way to warn about nil types is through documentation; ex: https://github.com/tailscale/tailscale/blob/afaa23c3b4c5f/sy... (a recent example I stumbled upon).

Static code analysers like nilaway (https://news.ycombinator.com/item?id=38300425) help, but these aren't without false positives & false negatives.

Re:Go Subtleties You May Not Know by peterashford on Thursday October 23, 2025 @01:42AM (#45678512)
I read & write Go regularly, and I hate its error handling intensely