diff --git a/libnetwork/options/options.go b/libnetwork/options/options.go index 06d8ae59024c8a448dc26c40e74853285ca38271..4534f2c4f75ac6a21a447fd6e8a3b3878a30f1b8 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 50883f990a723a1f30230aed3b6f8efd7315cdcd..e843ae405e77c8cbb57f457897a3c9f2f4c6844a 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