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

Fix G307 warning: Deferring unsafe method "Close" on type "*os.File" #1154

Merged
merged 2 commits into from
Apr 19, 2023

Conversation

rgmz
Copy link
Contributor

@rgmz rgmz commented Apr 17, 2023

Description:

Minor change to fix GoSec flagging this line:

defer file.Close()

Explanation: securego/gosec#512

Checklist:

  • Does your PR pass tests?
  • Have you written new tests for your changes?
  • Have you lint your code locally prior to submission?

@rgmz rgmz force-pushed the fix/G307-unsafe-file-close branch 2 times, most recently from 1138cd3 to ae83ee1 Compare April 17, 2023 21:34
@rgmz rgmz force-pushed the fix/G307-unsafe-file-close branch from ae83ee1 to 4a19810 Compare April 18, 2023 01:09
@zricethezav
Copy link
Collaborator

LGTM, thanks @rgmz

@zricethezav zricethezav merged commit 81cf308 into gitleaks:master Apr 19, 2023
1 check passed
@rgmz rgmz deleted the fix/G307-unsafe-file-close branch April 24, 2023 13:40
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

2 participants