You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The feature itself is welcome, but I’m not entirely sure yet about how it should look like:
I have to admit that I don’t have more experience with error-wrapping packages than the pure knowledge of github.com/pkg/errors’s existence. I know that there are others, and I don’t know whether they are all used the same way, or if there are multiple legit ways to use these packages.
Regarding your suggestion, I think adding errors.Wrap is fine, but just adding fmt.Errorf seems too brittle — I think we should make it fmt.Errorf("%v", err) at least.
I’m not sure how much customization is necessary/warranted here. I.e., would -wrap identify one of multiple pre-defined wrapping strategies? It seems like any kind of templating support would open a can of worms :)
You frequently want to add a function call to errors, such as:
or:
It would be nice if you could do something like:
Which would result in:
The pipe is the location of the cursor; the location of that could be added in the
-format json
output.I can take a look at this later if feel this would be a good addition.
The text was updated successfully, but these errors were encountered: