4 ms·
> I’m not a go developer. How does go document how a function can fail? There's no magic to it. Errors are values, so it's a part of the function signature tha
by mtzet 3y ago
> I’m not a go developer. How does go document how a function can fail?
There's no magic to it. Errors are values, so it's a part of the function signature that there's an error code to check. In C++ any function can throw an exception and there's no way of knowing that it wont.
It's true that go doesn't document what _kinds_ of errors it can throw, but at least I know there's something to check.
- vips7L 3y agoBut that doesn’t document _how_ a function can fail. Just that it _can_ fail.