Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
lint-project.sh
script currently runsgolangci-lint
in two separate instances. Initially, it's executed with all linters turned off except for forbidigo (see reference). Following this, it is run again, this time with all linters enabled except for forbidigo (see reference).To bypass the forbidigo linter for specific files that utilize
panic
, the//nolint
directive was used. This directive was effective only during the first instance of the linting process. However, during the second linting round, the//nolint
directive becomes superfluous since forbidigo is not active. This redundancy leads to the detection of an unusednolintlint
directive error, as illustrated in the following output:With this PR, we introduce the GOLANGCI_ALLOW_PANIC environment variable. When it's set to yes, no checks for panic are performed by forbidigo. It's done similarly to
GOLANGCI_ALLOW_PRINT
.P.S. it's not a viable option to remove
panic
from https://github.com/moov-io/iso8583/ (see moov-io/iso8583#269)