anishathalye / porcupine

A fast linearizability checker written in Go 🔎
https://anishathalye.com/testing-distributed-systems-for-linearizability/
MIT License
958 stars 53 forks source link

Revert to prev staticcheck pkg pattern #19

Closed sanjit-bhat closed 6 months ago

sanjit-bhat commented 6 months ago

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 your go.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 (not go.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.

anishathalye commented 6 months ago

Good catch, thanks for the PR! Added the above info to the commit message in 036c299 and merged in d372c58.