3 ms·
I really fail to see how "Go's idioms around error handling" would make NPE rarer than in Java either. In java, an error is an exception and will bubble up to
by masklinn 9y ago
I really fail to see how "Go's idioms around error handling" would make NPE rarer than in Java either.
In java, an error is an exception and will bubble up to the handler, it has very little reason to "birth" null references.
In Go, an error is a non-nil value next to a zero (often nil) value, and a success is the reverse, so error handling always injects new nils which you're supposed to carefully not used (since no sum types).