summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/cpuid/cpuid_parse_x86_test.go12
-rw-r--r--pkg/seccomp/BUILD1
2 files changed, 7 insertions, 6 deletions
diff --git a/pkg/cpuid/cpuid_parse_x86_test.go b/pkg/cpuid/cpuid_parse_x86_test.go
index c9bd40e1b..e4ae0d689 100644
--- a/pkg/cpuid/cpuid_parse_x86_test.go
+++ b/pkg/cpuid/cpuid_parse_x86_test.go
@@ -32,27 +32,27 @@ func kernelVersion() (int, int, error) {
return 0, 0, err
}
- var r string
+ var sb strings.Builder
for _, b := range u.Release {
if b == 0 {
break
}
- r += string(b)
+ sb.WriteByte(byte(b))
}
- s := strings.Split(r, ".")
+ s := strings.Split(sb.String(), ".")
if len(s) < 2 {
- return 0, 0, fmt.Errorf("kernel release missing major and minor component: %s", r)
+ return 0, 0, fmt.Errorf("kernel release missing major and minor component: %s", sb.String())
}
major, err := strconv.Atoi(s[0])
if err != nil {
- return 0, 0, fmt.Errorf("error parsing major version %q in %q: %v", s[0], r, err)
+ return 0, 0, fmt.Errorf("error parsing major version %q in %q: %w", s[0], sb.String(), err)
}
minor, err := strconv.Atoi(s[1])
if err != nil {
- return 0, 0, fmt.Errorf("error parsing minor version %q in %q: %v", s[1], r, err)
+ return 0, 0, fmt.Errorf("error parsing minor version %q in %q: %w", s[1], sb.String(), err)
}
return major, minor, nil
diff --git a/pkg/seccomp/BUILD b/pkg/seccomp/BUILD
index 29aeaab8c..bdef7762c 100644
--- a/pkg/seccomp/BUILD
+++ b/pkg/seccomp/BUILD
@@ -10,6 +10,7 @@ go_binary(
"seccomp_test_victim_amd64.go",
"seccomp_test_victim_arm64.go",
],
+ nogo = False,
deps = [":seccomp"],
)