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

unable to suppress G307 with configuration #900

Closed
varkey98 opened this issue Dec 8, 2022 · 1 comment
Closed

unable to suppress G307 with configuration #900

varkey98 opened this issue Dec 8, 2022 · 1 comment

Comments

@varkey98
Copy link

varkey98 commented Dec 8, 2022

Summary

Tried to suppress G307 issue similar to G104 as mentioned in the readme file

{
    "G307": {
            "os.File": ["Close"]
    }
}

Steps to reproduce the behavior

defer os.File.Close()
run with this conf:

{
    "G307": {
            "os.File": ["Close"]
    }
}

gosec version

Version: dev
Git tag:
Build date:

Go version (output of 'go version')

go version go1.18.5 linux/amd64

Operating system / Environment

Ubuntu x64

Expected behavior

Dont know if this rule is supported, if it is then this code should not have flagged.

Actual behavior

This code snippet is getting flagged in the gosec report.

@ccojocar
Copy link
Member

ruled removed in #900

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

No branches or pull requests

2 participants