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 ( import (
"crypto/md5" // ERROR "G501: Blacklisted import `crypto/md5`: weak cryptographic primitive" "crypto/md5" // ERROR "G501: Blacklisted import `crypto/md5`: weak cryptographic primitive"
"fmt"
"log" "log"
"os"
) )
func Gosec() { func Gosec() {
@ -20,3 +22,8 @@ func GosecNolintGosec() {
h := md5.New() //nolint:gosec h := md5.New() //nolint:gosec
log.Print(h) log.Print(h)
} }
func GosecNoErrorCheckingByDefault() {
f, _ := os.Create("foo")
fmt.Println(f)
}