diff --git a/testutils/source.go b/testutils/source.go index 7a9e3f8add..b336a4834b 100644 --- a/testutils/source.go +++ b/testutils/source.go @@ -2097,50 +2097,6 @@ func main() { fmt.Printf("wrote %d bytes\n", n2) }`}, 1, gosec.NewConfig()}, - {[]string{`package main - -import ( - "fmt" - "io/ioutil" - "log" - "os" -) - -func check(e error) { - if e != nil { - panic(e) - } -} - -func main() { - - d1 := []byte("hello\ngo\n") - err := ioutil.WriteFile("/tmp/dat1", d1, 0744) - check(err) - - allowed := ioutil.WriteFile("/tmp/dat1", d1, 0600) - check(allowed) - - f, err := os.Create("/tmp/dat2") - check(err) - - defer func() { - err := f.Close() - if err != nil { - log.Println(err) - } - }() - - d2 := []byte{115, 111, 109, 101, 10} - n2, err := f.Write(d2) - - err := f.Sync() - check(err) - - defer check(err) - fmt.Printf("wrote %d bytes\n", n2) - -}`}, 0, gosec.NewConfig()}, } // SampleCodeG401 - Use of weak crypto MD5