Open t0yv0 opened 1 year ago
Echoing Slack:
I believe you already have the appropriate tooling in the repository.
go test
runs go vet
by default, which includes this linter by default.
golangci-lint also includes govet
as a linter and it's enabled:
https://github.com/pulumi/pulumi-terraform-bridge/blob/master/.golangci.yml#L14
cd pf && golangci-lint run -c ../.golangci.yml
is silent about this bug.
make lint
also - that one is calling my strange script to call golangci-lint for every go.mod in the repository but it might have been missing redirecting golangci-lint to the right config (-c ../.golangci.yml
).
go vet
doesn't catch it either. Interesting.
This finds it (thanks @AaronFriel)
go install github.com/fatanugraha/noloopclosure/cmd/noloopclosure@latest
cd pf && ~/go/bin/noloopclosure ./...
At v0.1.2
But not when installed into golangci-lint as a plugin for some reason.
Thanks to @abhinav for pointers:
We should install the tooling that checks this. It's going to be time saver.