mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
G601: Implicit memory aliasing in for loop
daemon/cluster/executor/container/adapter.go:446:42: G601: Implicit memory aliasing in for loop. (gosec)
req := c.container.volumeCreateRequest(&mount)
^
daemon/network.go:577:10: G601: Implicit memory aliasing in for loop. (gosec)
np := &n
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b4c0c7c076
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
e8b838e99f
commit
b6de0ca7c5
2 changed files with 4 additions and 3 deletions
|
@ -431,6 +431,7 @@ func (c *containerAdapter) remove(ctx context.Context) error {
|
|||
func (c *containerAdapter) createVolumes(ctx context.Context) error {
|
||||
// Create plugin volumes that are embedded inside a Mount
|
||||
for _, mount := range c.container.task.Spec.GetContainer().Mounts {
|
||||
mount := mount
|
||||
if mount.Type != api.MountTypeVolume {
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -573,9 +573,9 @@ func (daemon *Daemon) GetNetworks(filter filters.Args, config types.NetworkListC
|
|||
}
|
||||
|
||||
if config.Detailed {
|
||||
for i, n := range list {
|
||||
np := &n
|
||||
buildDetailedNetworkResources(np, idx[n.ID], config.Verbose)
|
||||
for i := range list {
|
||||
np := &list[i]
|
||||
buildDetailedNetworkResources(np, idx[np.ID], config.Verbose)
|
||||
list[i] = *np
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue