Skip to content
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

lint: make staticcheck happy on go 1.12 #36527

Merged
merged 1 commit into from
Apr 4, 2019
Merged

Conversation

dt
Copy link
Member

@dt dt commented Apr 4, 2019

the main issue is cgo generating 0==0, so we'll turn off that lint rule completely for now.
Also, the regex copy rule is specific to go1.12 so we'll disable it on the log call while we still support go 1.11.

Release note: none

@dt dt requested review from bdarnell and nvanbenschoten April 4, 2019 13:16
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dt
Copy link
Member Author

dt commented Apr 4, 2019

ugh, looks like the inline comment to disable the new rule doesn't play well on go 1.11 since there isn't a violation to disable there.

the main issue is cgo generating 0==0, so we'll turn off that lint rule completely for now.
Also, the regex copy rule is specific to go1.12 so we'll disable it on the log call while we still support go 1.11.

Release note: none
@dt
Copy link
Member Author

dt commented Apr 4, 2019

switched to a glob-based ignore so it won't complain if it doesn't actually ignore anything.

@dt
Copy link
Member Author

dt commented Apr 4, 2019

bors r+

craig bot pushed a commit that referenced this pull request Apr 4, 2019
36527: lint: make staticcheck happy on go 1.12 r=dt a=dt

the main issue is cgo generating 0==0, so we'll turn off that lint rule completely for now.
Also, the regex copy rule is specific to go1.12 so we'll disable it on the log call while we still support go 1.11.

Release note: none

Co-authored-by: David Taylor <[email protected]>
@craig
Copy link
Contributor

craig bot commented Apr 4, 2019

Build succeeded

@craig craig bot merged commit 53ae2f6 into cockroachdb:master Apr 4, 2019
@dt dt deleted the staticcheck branch April 4, 2019 19:17
@dt dt mentioned this pull request Apr 4, 2019
5 tasks
// TODO(dt): remove when https://github.com/dominikh/go-tools/issues/430 is resolved.
ignoreSA4000{},
// We still support go 1.11 where regex.Copy avoids contention.
&lint.GlobIgnore{Pattern: "github.com/cockroachdb/cockroach/pkg/util/log/clog.go", Checks: []string{"SA1019"}},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once I fix dominikh/go-tools#437 you'll be able to use the -go 1.11 flag to not generate deprecation warnings for things that were deprecated in later versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants