Revert to prev staticcheck pkg pattern #19
Closed
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.
According to the staticcheck cli docs, the pkg pattern is parsed just like in normal Go commands. So
./...
is the right way to test all pkgs recursively, including test files.As to why this wasn't catching the ioutil deprecation warning (see previous discussion), I figured it out!
ioutil
was only deprecated in Go 1.19. Since yourgo.mod
version is 1.16, staticcheck doesn't flag it. When you switched to*.go
, it treated each Go file independently, which uses the system (notgo.mod
) Go version but also 1) might trigger false positives that lack pkg context to resolve and 2) doesn't recursively check things.I think it's better to switch back to
./...
, and if you want to catch those deprecation issues, bump the go version, at the risk of making problems for upstream deps.