From abd11cfd08430ec5f9d2c6dbd0e0f798816922d1 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Tue, 15 Jul 2025 16:43:33 +0200 Subject: all: apply linter auto fixes ./tools/syz-env bin/golangci-lint run ./... --fix --- pkg/build/build.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'pkg/build') diff --git a/pkg/build/build.go b/pkg/build/build.go index 86906a0f7..26ba8f4d3 100644 --- a/pkg/build/build.go +++ b/pkg/build/build.go @@ -156,13 +156,14 @@ type builder interface { func getBuilder(targetOS, targetArch, vmType string) (builder, error) { if targetOS == targets.Linux { - if vmType == targets.GVisor { + switch vmType { + case targets.GVisor: return gvisor{}, nil - } else if vmType == "cuttlefish" { + case "cuttlefish": return cuttlefish{}, nil - } else if vmType == "proxyapp:android" { + case "proxyapp:android": return android{}, nil - } else if vmType == targets.Starnix { + case targets.Starnix: return starnix{}, nil } } @@ -266,7 +267,7 @@ func extractCauseInner(s []byte, kernelSrc string) ([]byte, string) { file := "" for i := range lines { if stripPrefix != nil { - lines[i] = bytes.Replace(lines[i], stripPrefix, nil, -1) + lines[i] = bytes.ReplaceAll(lines[i], stripPrefix, nil) } if file == "" { for _, fileRe := range fileRes { @@ -292,8 +293,8 @@ func extractCauseInner(s []byte, kernelSrc string) ([]byte, string) { res := bytes.Join(lines, []byte{'\n'}) // gcc uses these weird quotes around identifiers, which may be // mis-rendered by systems that don't understand utf-8. - res = bytes.Replace(res, []byte("‘"), []byte{'\''}, -1) - res = bytes.Replace(res, []byte("’"), []byte{'\''}, -1) + res = bytes.ReplaceAll(res, []byte("‘"), []byte{'\''}) + res = bytes.ReplaceAll(res, []byte("’"), []byte{'\''}) return res, file } -- cgit mrf-deployment