polyfloyd / go-errorlint

A source code linter that can be used to find code that will cause problems with Go's error wrapping scheme
MIT License
249 stars 19 forks source link

multiple Error wrapping #7

Closed K4L1Ma closed 4 years ago

K4L1Ma commented 4 years ago

Scenario Let's say that we have a package importing an external package when that package returns an err, and we want to wrap the external error into an error from our package, so we can use errors.Is on our typed error without losing the traceability of previous errors on the stack

Feature: We should be able to use fmt.Errorf with multiple errors without raising the lint since no multiple %w are allowed and at least 1 %w as been provided

ex: fmt.Errorf("%w:%v", ErrMyPkgCustomError, errExtentalPkgError)

K4L1Ma commented 4 years ago

this was already fixed, https://github.com/polyfloyd/go-errorlint/issues/5, my bad