From d267daa0282175695b61f6e9adb1b0c94f149373 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Sat, 23 Oct 2021 08:55:58 -0400 Subject: [PATCH] .builds: ignore buggy gosec warning Currently gosec is throwing warnings for any defer statement that closes a file (even if the error is handled) due to a bug. Once securego/gosec#714 is fixed and a release has been made this patch can be reverted. Signed-off-by: Sam Whited --- .builds/validate.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.builds/validate.yml b/.builds/validate.yml index 523e262c..4364d4c8 100644 --- a/.builds/validate.yml +++ b/.builds/validate.yml @@ -46,7 +46,9 @@ tasks: staticcheck ./... # gosec does not handle modules correctly. # See: https://github.com/securego/gosec/issues/622 - gosec -exclude-dir=examples ./... + # It also does not handle deferred close statements correctly (G307). + # See: https://github.com/securego/gosec/issues/714 + gosec -exclude=G307 -exclude-dir=examples ./... checkdoc -fileheader.pattern='-' ./... <