3 ms·
try() implicitly returns when there's an error, and sets the error in the case of an error. Then the defer statement would handle the error, as the return is ha
by ixwt 7y ago
try() implicitly returns when there's an error, and sets the error in the case of an error. Then the defer statement would handle the error, as the return is happening.
- kodablah 7y agoI'm saying it doesn't match what "existing" is doing which doesn't wrap the error. If you want comparable examples, they need to be doing the same thing, not one wrapping w/ an Errorf and another not.