You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 9, 2021. It is now read-only.
At the moment there's no way to specify build tags when running golint. When running on specific files this is no problem (it will lint whatever file is specified), but that would be very useful when linting packages. Otherwise it silently ignores the files in the package that are not loaded due to a missing build tag.
I'd suggest adding a command-line flag called -tags, the same as for the go build flag, that would take a space-separated list of tags to define.
AFAICS, the only change required is in golint/golint.go, to set the specified build tags on a custom build.Context struct and use that context to import code (could even be set directly on build.Default as this is a command-line tool, doesn't impact anything else).
Let me know if that would be a welcome change, happy to provide a PR if that is the case.
Thanks,
Martin
The text was updated successfully, but these errors were encountered:
I would really like to see this change. Without it, I'm not able to see any errors in my integration tests that are setup with // +build integration unless I actually try to run them. If we had -tags support for golint, I would be able to set the build tags and view the errors in real time in my editor.
Thank you for submitting this issue! As per golang/go#38968, we are freezing and deprecating golint. There's no drop-in replacement to golint per se, but you should find that Staticcheck works well in encouraging good Go code, much like golint did in the past, since it also includes style checks. There's always gofmt and go vet too, of course.
If you would like to contribute further, I'd encourage you to engage Staticcheck's issue tracker or look at vet's open issues, as they are both actively maintained. If you have an idea that doesn't fit into either of those tools, you could look at other Go linters, or write your own - these days it's fairly straightforward with go/analysis.
To help avoid confusion, I'm closing all issues before we freeze the repository. If you have any feedback, you can leave a comment on the proposal thread where it was decided to deprecate golint - though note that the proposal has been accepted for nearly a year. Thanks!
Hello,
At the moment there's no way to specify build tags when running
golint
. When running on specific files this is no problem (it will lint whatever file is specified), but that would be very useful when linting packages. Otherwise it silently ignores the files in the package that are not loaded due to a missing build tag.I'd suggest adding a command-line flag called
-tags
, the same as for the go build flag, that would take a space-separated list of tags to define.AFAICS, the only change required is in golint/golint.go, to set the specified build tags on a custom
build.Context
struct and use that context to import code (could even be set directly onbuild.Default
as this is a command-line tool, doesn't impact anything else).Let me know if that would be a welcome change, happy to provide a PR if that is the case.
Thanks,
Martin
The text was updated successfully, but these errors were encountered: