diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-07-15 16:43:33 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-07-17 08:31:25 +0000 |
| commit | abd11cfd08430ec5f9d2c6dbd0e0f798816922d1 (patch) | |
| tree | 522a8cc072d07d85c8a1d37b5b3ab89483599b48 /prog | |
| parent | a81f309b57265e5760b926274e1f1681e7550e41 (diff) | |
all: apply linter auto fixes
./tools/syz-env bin/golangci-lint run ./... --fix
Diffstat (limited to 'prog')
| -rw-r--r-- | prog/any.go | 5 | ||||
| -rw-r--r-- | prog/meta.go | 2 | ||||
| -rw-r--r-- | prog/minimization_test.go | 7 |
3 files changed, 8 insertions, 6 deletions
diff --git a/prog/any.go b/prog/any.go index cb49f3494..3969a5386 100644 --- a/prog/any.go +++ b/prog/any.go @@ -49,9 +49,10 @@ func (target *Target) initAnyTypes() { } func (target *Target) getAnyPtrType(size uint64) *PtrType { - if size == target.PtrSize { + switch size { + case target.PtrSize: return target.any.ptrPtr - } else if size == 8 { + case 8: return target.any.ptr64 } panic(fmt.Sprintf("bad pointer size %v", size)) diff --git a/prog/meta.go b/prog/meta.go index 5c23627df..3524963c0 100644 --- a/prog/meta.go +++ b/prog/meta.go @@ -22,7 +22,7 @@ func GitRevisionKnown() bool { } func init() { - GitRevisionBase = strings.Replace(GitRevision, "+", "", -1) + GitRevisionBase = strings.ReplaceAll(GitRevision, "+", "") if gitRevisionDate != "" { var err error if GitRevisionDate, err = time.Parse("20060102-150405", gitRevisionDate); err != nil { diff --git a/prog/minimization_test.go b/prog/minimization_test.go index e8f1d40e5..696e9e446 100644 --- a/prog/minimization_test.go +++ b/prog/minimization_test.go @@ -272,7 +272,8 @@ getuid() 11, func(p *Prog, callIndex int) bool { pp := strings.TrimSpace(string(p.Serialize())) - if attempt == 0 { + switch attempt { + case 0: if pp == strings.TrimSpace(` getpid() r0 = open(&(0x7f0000000040)='./file0', 0x0, 0x0) @@ -289,7 +290,7 @@ fcntl$getflags(r0, 0x0) `) { return false } - } else if attempt == 1 { + case 1: if pp == strings.TrimSpace(` r0 = open(&(0x7f0000000040)='./file0', 0x0, 0x0) read(r0, &(0x7f0000000040), 0x10) @@ -301,7 +302,7 @@ close(r2) `) { return true } - } else { + default: return false } panic(fmt.Sprintf("unexpected candidate on attempt %v:\n%v", attempt, pp)) |
