-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gosec: handling of global nosec option when it is false (#5228)
- Loading branch information
1 parent
7ac2044
commit 87ea9ef
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//golangcitest:args -Egosec | ||
//golangcitest:config_path testdata/gosec_nosec.yml | ||
package testdata | ||
|
||
import ( | ||
"crypto/md5" // want "G501: Blocklisted import crypto/md5: weak cryptographic primitive" | ||
"log" | ||
) | ||
|
||
func Gosec() { | ||
// #nosec G401 | ||
h := md5.New() | ||
log.Print(h) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
linters-settings: | ||
gosec: | ||
config: | ||
global: | ||
nosec: false |