Skip to content

Commit

Permalink
Remove test for synced closed file for now.
Browse files Browse the repository at this point in the history
Will add this later
  • Loading branch information
elgohr committed Jul 31, 2021
1 parent 743a908 commit 33f7436
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions testutils/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 33f7436

Please sign in to comment.