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
248 stars 19 forks source link

fix: init functions and AllowPair fields #74

Closed ldez closed 7 months ago

ldez commented 7 months ago

golangci-lint uses go-errorlint as a lib, then init functions can be a problem because they are always called.

The PR removes the need to use init functions:

The new signature of NewAnalyzer allows to set use options but the fields of AllowPair are not exposed, so it's impossible to use WithAllowedErrors or WithAllowedWildcard. The PR exposes the fields err and fun of the structure AllowPair.

Related to #69

polyfloyd commented 7 months ago

Nice, thanks!

ldez commented 7 months ago

@polyfloyd could you create a new tag?

polyfloyd commented 7 months ago

Yes! Of course. CI should be running now

ldez commented 7 months ago

Thank you :heart: