Skip to content

Commit

Permalink
go-fuzz-build: gofmt main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
josharian committed Oct 19, 2023
1 parent 95bc4d7 commit 6a27b0a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions go-fuzz-build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ func (c *Context) loadPkg(pkg string) {
}

// isFuzzSig reports whether sig is of the form
// func FuzzFunc(data []byte) int
//
// func FuzzFunc(data []byte) int
func isFuzzSig(sig *types.Signature) bool {
return tupleHasTypes(sig.Params(), "[]byte") && tupleHasTypes(sig.Results(), "int")
}
Expand Down Expand Up @@ -780,7 +781,7 @@ func (c *Context) copyFile(src, dst string) {
if err != nil {
c.failf("copyFile: could not read %v", src, err)
}
w, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0700)
w, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o700)
if err != nil {
c.failf("copyFile: could not write %v: %v", dst, err)
}
Expand Down Expand Up @@ -831,13 +832,13 @@ func (c *Context) readFile(name string) []byte {
}

func (c *Context) writeFile(name string, data []byte) {
if err := ioutil.WriteFile(name, data, 0700); err != nil {
if err := ioutil.WriteFile(name, data, 0o700); err != nil {
c.failf("failed to write temp file: %v", err)
}
}

func (c *Context) mkdirAll(dir string) {
if err := os.MkdirAll(dir, 0700); err != nil {
if err := os.MkdirAll(dir, 0o700); err != nil {
c.failf("failed to create temp dir: %v", err)
}
}
Expand Down

0 comments on commit 6a27b0a

Please sign in to comment.