Skip to content

Commit 901cf25

Browse files
committed
dev: add gosec test case
1 parent 96af958 commit 901cf25

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/testdata/gosec.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ package testdata
33

44
import (
55
"crypto/md5" // ERROR "G501: Blacklisted import `crypto/md5`: weak cryptographic primitive"
6+
"fmt"
67
"log"
8+
"os"
79
)
810

911
func Gosec() {
@@ -20,3 +22,8 @@ func GosecNolintGosec() {
2022
h := md5.New() //nolint:gosec
2123
log.Print(h)
2224
}
25+
26+
func GosecNoErrorCheckingByDefault() {
27+
f, _ := os.Create("foo")
28+
fmt.Println(f)
29+
}

0 commit comments

Comments
 (0)