-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go-require: lots of false positives when scanning the gateway-api repo #67
Comments
hi, @dprotaso! thank you for request. not false positive: // kubernetes/certificate.go:45:2: empty: use require.NotEmpty
require.Greater(t, len(hosts), 0, "require a non-empty hosts for Subject Alternate Name values") not false positive: // gateway-modify-listeners.go:152:4: len: use require.Lenf
require.Equalf(t, 2, len(mutate.Spec.Listeners), "the gateway must have 2 listeners") not false positive: // utils/http/mirror.go:47:4: go-require: require must only be used in the goroutine running the test function
for _, mirrorPod := range mirrorPods {
go func(mirrorPod BackendRef) {
defer wg.Done()
require.Eventually(t, func() bool { About another Anyway you can just disable one checker, not overall linter 👌 |
@dprotaso, thanks for this tricky case fixed!
|
awesome thanks @Antonboom - yeah some of them are not false positives. What's the best way to pick up these changes? The project is using golangci-lint |
golangci-lint will pull the new version automatically and these changes will be available in the new golangci-lint's release |
git clone https://github.com/kubernetes-sigs/gateway-api.git cd gateway-api git checkout 4f71b2306e7df666a8528dda59ede6620ad0e4e2 go install github.com/Antonboom/testifylint@latest testifylint ./...
You'll see tons of false positives - I've disabled the linter so it's important to checkout the repo at that SHA
There are no go-routines in
/gateway-api/conformance/tests/gateway-static-addresses.go
See: https://github.com/kubernetes-sigs/gateway-api/blob/4f71b2306e7df666a8528dda59ede6620ad0e4e2/conformance/tests/gateway-static-addresses.go
The text was updated successfully, but these errors were encountered: