3 ms·
You actually should never return a specific error pointer because you can eventually break nil checks. I caused a production outage because interfaces are tuple
by inlined 2y 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]
- stouset 2y agoIt's really hard to reconcile behavior like this with people's seemingly unshakeable love for golang's error handling.
- TheDong 2y agoPeople 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 https://paulgraham.com/avg.html