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

Silence false positive lints from staticcheck in tbot/init.go #11084

Merged
merged 2 commits into from
Mar 14, 2022

Conversation

timothyb89
Copy link
Contributor

staticcheck does not seem to appreciate our nop implementations for non-Linux OSes and produces several noisy warnings about it. This disables the lints as precisely as possible.

`staticcheck` does not seem to appreciate our nop implementations for
non-Linux OSes and produces several noisy warnings about it. This
disables the lints as precisely as possible.
Copy link
Collaborator

@zmb3 zmb3 left a comment

Choose a reason for hiding this comment

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

womp womp

Comment on lines 91 to 93
func VerifyACL(path string, opts *ACLOptions) error {
return trace.NotImplemented("ACLs not supported on this platform")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func VerifyACL(path string, opts *ACLOptions) error {
return trace.NotImplemented("ACLs not supported on this platform")
}
func VerifyACL(path string, opts *ACLOptions) error {
if false {
return nil
}
return trace.NotImplemented("ACLs not supported on this platform")
}

I think you can trick the linter like this.

//nolint:staticcheck is also good as long as we remember clean them later. Thanks for fixing!

@timothyb89 timothyb89 enabled auto-merge (squash) March 14, 2022 16:32
@timothyb89 timothyb89 merged commit 9769698 into master Mar 14, 2022
@timothyb89 timothyb89 deleted the timothyb89/tbot-init-lints-macos branch March 14, 2022 16:55
timothyb89 added a commit that referenced this pull request Mar 14, 2022
`staticcheck` does not seem to appreciate our nop implementations for
non-Linux OSes and produces several noisy warnings about it. This
disables the lints as precisely as possible.
timothyb89 added a commit that referenced this pull request Mar 16, 2022
#11128)

`staticcheck` does not seem to appreciate our nop implementations for
non-Linux OSes and produces several noisy warnings about it. This
disables the lints as precisely as possible.
@webvictim webvictim mentioned this pull request Apr 19, 2022
@webvictim webvictim mentioned this pull request Jun 8, 2022
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.

None yet

4 participants