Skip to content

Commit 43f9cdd

Browse files
authored
Merge pull request #12129 from thaJeztah/noshadow
cmd/ctr: rename vars that shadowed builtin
2 parents 6373c7b + ed174c9 commit 43f9cdd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cmd/ctr/commands/run/run_unix.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,17 @@ func NewContainer(ctx context.Context, client *containerd.Client, cliContext *cl
243243
}
244244

245245
if caps := cliContext.StringSlice("cap-add"); len(caps) > 0 {
246-
for _, cap := range caps {
247-
if !strings.HasPrefix(cap, "CAP_") {
246+
for _, c := range caps {
247+
if !strings.HasPrefix(c, "CAP_") {
248248
return nil, errors.New("capabilities must be specified with 'CAP_' prefix")
249249
}
250250
}
251251
opts = append(opts, oci.WithAddedCapabilities(caps))
252252
}
253253

254254
if caps := cliContext.StringSlice("cap-drop"); len(caps) > 0 {
255-
for _, cap := range caps {
256-
if !strings.HasPrefix(cap, "CAP_") {
255+
for _, c := range caps {
256+
if !strings.HasPrefix(c, "CAP_") {
257257
return nil, errors.New("capabilities must be specified with 'CAP_' prefix")
258258
}
259259
}

0 commit comments

Comments
 (0)