dev: add gosec test case
This commit is contained in:
parent
96af958205
commit
901cf25e20
7
test/testdata/gosec.go
vendored
7
test/testdata/gosec.go
vendored
@ -3,7 +3,9 @@ package testdata
|
||||
|
||||
import (
|
||||
"crypto/md5" // ERROR "G501: Blacklisted import `crypto/md5`: weak cryptographic primitive"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
func Gosec() {
|
||||
@ -20,3 +22,8 @@ func GosecNolintGosec() {
|
||||
h := md5.New() //nolint:gosec
|
||||
log.Print(h)
|
||||
}
|
||||
|
||||
func GosecNoErrorCheckingByDefault() {
|
||||
f, _ := os.Create("foo")
|
||||
fmt.Println(f)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user