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:
to load allowedErrorsMap
for the flags (this fixes a regression: issue #21 has been fixed with f57ae321623d3e45f7ca6010c6c11e2dbf53e849 but aed56418cd3705e4635c1be0c8951462bfeafb48 inverts the expected behavior).
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.
golangci-lint uses
go-errorlint
as a lib, theninit
functions can be a problem because they are always called.The PR removes the need to use
init
functions:allowedErrorsMap
The new signature of
NewAnalyzer
allows to set use options but the fields ofAllowPair
are not exposed, so it's impossible to useWithAllowedErrors
orWithAllowedWildcard
. The PR exposes the fieldserr
andfun
of the structureAllowPair
.Related to #69