tomarrell / wrapcheck

A Go linter to check that errors from external packages are wrapped
https://blog.tomarrell.com/post/introducing_wrapcheck_linter_for_go
MIT License
291 stars 26 forks source link

Ability to ignore calls wrapped in a helper function #44

Closed mwgamble closed 8 months ago

mwgamble commented 8 months ago

The package lo defines a series of helper functions named TryOr:

https://github.com/samber/lo#tryor

These functions accept a function and a default value. If the function returns an error, the default value is returned instead.

In these cases, I don't care what the error is, and it's discarded inside the helper function. I don't have a need to wrap these errors, but right now I don't have a good way to ignore those cases.

tomarrell commented 8 months ago

You can just add a custom ignore signature to match this function.