Comment by inlined
2 months ago
You actually should never return a specific error pointer because you can eventually break nil checks. I caused a production outage because interfaces are tuples of type and pointer and the literal nil turns to [nil, nil] when getting passed to a comparator whereas your struct return value will be [nil, *Type]
It's really hard to reconcile behavior like this with people's seemingly unshakeable love for golang's error handling.
People who rave about Go's error handling, in my experience, are people who haven't used rust or haskell, and instead have experience with javascript, python, and/or C.
https://paulgraham.com/avg.html