diff --git a/libnetwork/options/options.go b/libnetwork/options/options.go index 06d8ae5902..4534f2c4f7 100644 --- a/libnetwork/options/options.go +++ b/libnetwork/options/options.go @@ -42,12 +42,7 @@ func (e TypeMismatchError) Error() string { } // Generic is a basic type to store arbitrary settings. -type Generic map[string]interface{} - -// NewGeneric returns a new Generic instance. -func NewGeneric() Generic { - return make(Generic) -} +type Generic map[string]any // GenerateFromModel takes the generic options, and tries to build a new // instance of the model's type by matching keys from the generic options to diff --git a/libnetwork/options/options_test.go b/libnetwork/options/options_test.go index 50883f990a..e843ae405e 100644 --- a/libnetwork/options/options_test.go +++ b/libnetwork/options/options_test.go @@ -7,10 +7,11 @@ import ( ) func TestGenerate(t *testing.T) { - gen := NewGeneric() - gen["Int"] = 1 - gen["Rune"] = 'b' - gen["Float64"] = 2.0 + gen := Generic{ + "Int": 1, + "Rune": 'b', + "Float64": 2.0, + } type Model struct { Int int @@ -39,10 +40,11 @@ func TestGenerate(t *testing.T) { } func TestGeneratePtr(t *testing.T) { - gen := NewGeneric() - gen["Int"] = 1 - gen["Rune"] = 'b' - gen["Float64"] = 2.0 + gen := Generic{ + "Int": 1, + "Rune": 'b', + "Float64": 2.0, + } type Model struct { Int int