4 ms·
Rob Pike once talked about dealing with this: https://go.dev/blog/errors-are-values https://go.dev/blog/errors-are-values
by trealira 2y ago
Rob Pike once talked about dealing with this: https://go.dev/blog/errors-are-values https://go.dev/blog/errors-are-values
- stouset 2y agoNotably this approach is basically completely nonexistent in practice.
- wruza 2y agoHe basically simulates jump to catch by hand. I understand the authority of Rob Pike, but don’t understand why this idea is great. Processes IRL don’t look like write() three times. They look foo(); bar(); baz(); quux();, which weren’t designed to cooperate under a single context. If only there was an implicit err-ref argument which could be filled by some “throw” keyword and the rest would auto-skip to the “catch”.