diff --git a/testutils/g306_samples.go b/testutils/g306_samples.go index f8ab32a..0f1e8c9 100644 --- a/testutils/g306_samples.go +++ b/testutils/g306_samples.go @@ -21,7 +21,6 @@ func check(e error) { } func main() { - d1 := []byte("hello\ngo\n") err := ioutil.WriteFile("/tmp/dat1", d1, 0744) check(err) @@ -52,5 +51,25 @@ func main() { w.Flush() } +`}, 1, gosec.NewConfig()}, + {[]string{` +package main + +import ( + "io/ioutil" + "os" +) + +func check(e error) { + if e != nil { + panic(e) + } +} + +func main() { + content := []byte("hello\ngo\n") + err := ioutil.WriteFile("/tmp/dat1", content, os.ModePerm) + check(err) +} `}, 1, gosec.NewConfig()}, }