Hacker News new | ask | show | jobs
by gempir 6 days ago
Go has a good start for that, but It's not enough for me.

Gofmt is a great idea but it isn't strict enough for my taste. Go does not have any first party static analyzers, closest is Staticcheck which is even sponsored by Google themselves

1 comments

go vet, plus all the ones in gopls?
I don't believe you can add custom analyzers to `go vet`, which arguably rules it out.

But it is extremely simple to make a custom vet-like tool, because it's a trivial binary wrapper around the analysis framework, which is first-party (though it's structurally pretty limited by design, and won't handle all linting needs): https://cs.opensource.google/go/go/+/refs/tags/go1.26.5:src/...

-vettool allows using different analyzers built with the analysis framework: https://pkg.go.dev/cmd/go#:~:text=The%20%2Dvettool%3Dprog%20...