-
Notifications
You must be signed in to change notification settings - Fork 284
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
feat: add redundant-build-tag
rule
#1135
feat: add redundant-build-tag
rule
#1135
Conversation
7bdafcd
to
edbfc7e
Compare
Good idea. I'm unsure about the rule name, but it's a good thing. |
EDIT: I just checked, nothing detects it currently. It's funny because I reported something about it a few days ago @alexandear How did you find out the ``// +build:` directive ? |
I found // +build by reading the release notes for Go 1.18. Later, while reading the Go source, I came across go fix, which has a fix named buildtag. The command Here are my PRs that fix build tags: |
edbfc7e
to
dd996b2
Compare
dd996b2
to
1a2732a
Compare
redundant-old-build-tag
ruleredundant-build-tag
rule
Renamed to In the future, this rule can be extended with functionality to find redundant build tags like in this PR go-delve/delve#3556 |
Maybe you could open an issue to keep track of the idea |
This PR adds
redundant-build-tag
that suggests removing// +build
lines when//go:build
is present.According to the "Build constraints":
But gofmt doesn't automatically remove
// +build
lines.