Skip to content

Commit 931f7a1

Browse files
authored
Merge pull request #6753 from thaJeztah/minor_nits
cli/command/containerd: parseSecurityOpts: remove redundant sprintf
2 parents d5ed037 + ccbe206 commit 931f7a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cli/command/container/opts.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,11 +947,11 @@ func parseSecurityOpts(securityOpts []string) ([]string, error) {
947947
if err != nil {
948948
return securityOpts, fmt.Errorf("opening seccomp profile (%s) failed: %w", v, err)
949949
}
950-
b := bytes.NewBuffer(nil)
951-
if err := json.Compact(b, f); err != nil {
950+
var b bytes.Buffer
951+
if err := json.Compact(&b, f); err != nil {
952952
return securityOpts, fmt.Errorf("compacting json for seccomp profile (%s) failed: %w", v, err)
953953
}
954-
securityOpts[key] = fmt.Sprintf("seccomp=%s", b.Bytes())
954+
securityOpts[key] = "seccomp=" + b.String()
955955
}
956956
}
957957
}

0 commit comments

Comments
 (0)