Skip to content

Commit ccbe206

Browse files
committed
cli/command/containerd: parseSecurityOpts: remove redundant sprintf
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent d5ed037 commit ccbe206

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)