-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This one had me second guessing myself quite a lot. Turns out defer can't overwrite the return value so these are all not doing what it looks like they're doing[1]. In order to influence the return'd error we would have to used named return values so that err could be changed. I was going to just do a simple defer'd recover like: ``` func() { _ = recover() }() ``` to keep catching the panics and get the same result as today but decided to just do what was intendend instead. 1: https://go.dev/play/p/UIVjXdqajxI
- Loading branch information
Showing
1 changed file
with
30 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters