mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
volume/mounts: TestConvertTmpfsOptions: fix implicit memory aliasing (gosec)
volume/mounts/linux_parser_test.go:335:38: G601: Implicit memory aliasing in for loop. (gosec)
data, err := p.ConvertTmpfsOptions(&tc.opt, tc.readOnly)
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -332,10 +332,11 @@ func TestConvertTmpfsOptions(t *testing.T) {
|
||||
}
|
||||
p := NewLinuxParser()
|
||||
for _, tc := range cases {
|
||||
data, err := p.ConvertTmpfsOptions(&tc.opt, tc.readOnly)
|
||||
opt := tc.opt
|
||||
data, err := p.ConvertTmpfsOptions(&opt, tc.readOnly)
|
||||
if tc.err {
|
||||
if err == nil {
|
||||
t.Fatalf("expected error for %+v, got nil", tc.opt)
|
||||
t.Fatalf("expected error for %+v, got nil", opt)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user