aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/build
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-07-15 16:43:33 +0200
committerTaras Madan <tarasmadan@google.com>2025-07-17 08:31:25 +0000
commitabd11cfd08430ec5f9d2c6dbd0e0f798816922d1 (patch)
tree522a8cc072d07d85c8a1d37b5b3ab89483599b48 /pkg/build
parenta81f309b57265e5760b926274e1f1681e7550e41 (diff)
all: apply linter auto fixes
./tools/syz-env bin/golangci-lint run ./... --fix
Diffstat (limited to 'pkg/build')
-rw-r--r--pkg/build/build.go15
1 files changed, 8 insertions, 7 deletions
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
}