Skip to content

Commit e715dd5

Browse files
committed
cli/command/volume: remove uses of reflect in test
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 3811f24 commit e715dd5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cli/command/volume/create_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
2+
//go:build go1.24
3+
14
package volume
25

36
import (
47
"errors"
58
"fmt"
69
"io"
7-
"reflect"
10+
"maps"
811
"sort"
912
"strings"
1013
"testing"
@@ -124,10 +127,10 @@ func TestVolumeCreateWithFlags(t *testing.T) {
124127
if options.Driver != expectedDriver {
125128
return client.VolumeCreateResult{}, fmt.Errorf("expected driver %q, got %q", expectedDriver, options.Driver)
126129
}
127-
if !reflect.DeepEqual(options.DriverOpts, expectedOpts) {
130+
if !maps.Equal(options.DriverOpts, expectedOpts) {
128131
return client.VolumeCreateResult{}, fmt.Errorf("expected drivers opts %v, got %v", expectedOpts, options.DriverOpts)
129132
}
130-
if !reflect.DeepEqual(options.Labels, expectedLabels) {
133+
if !maps.Equal(options.Labels, expectedLabels) {
131134
return client.VolumeCreateResult{}, fmt.Errorf("expected labels %v, got %v", expectedLabels, options.Labels)
132135
}
133136
return client.VolumeCreateResult{

0 commit comments

Comments
 (0)