mirror of https://github.com/docker/cli.git
cli/command/stack/kubernetes: Using a reference for the variable on range scope `obj` (scopelint)
```
cli/command/stack/kubernetes/watcher_test.go:44:20: Using a reference for the variable on range scope `obj` (scopelint)
if err := o.Add(&obj); err != nil {
^
cli/command/stack/kubernetes/watcher_test.go:49:20: Using a reference for the variable on range scope `obj` (scopelint)
if err := o.Add(&obj); err != nil {
^
```
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 754fc6fe67
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
201e44907d
commit
73dad4356e
|
@ -41,11 +41,13 @@ func newTestPodAndStackRepository(initialPods []apiv1.Pod, initialStacks []apiv1
|
||||||
|
|
||||||
o := k8stesting.NewObjectTracker(scheme, codecs.UniversalDecoder())
|
o := k8stesting.NewObjectTracker(scheme, codecs.UniversalDecoder())
|
||||||
for _, obj := range initialPods {
|
for _, obj := range initialPods {
|
||||||
|
obj := obj
|
||||||
if err := o.Add(&obj); err != nil {
|
if err := o.Add(&obj); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, obj := range initialStacks {
|
for _, obj := range initialStacks {
|
||||||
|
obj := obj
|
||||||
if err := o.Add(&obj); err != nil {
|
if err := o.Add(&obj); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue