dev: add gosec test case

This commit is contained in:
Denis Isaev 2019-02-18 11:05:28 +03:00
parent 96af958205
commit 901cf25e20

View File

@ -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)
}