We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aac6365 commit 39b6cb5Copy full SHA for 39b6cb5
internal/args/unmarshal.go
@@ -99,6 +99,14 @@ var unmarshalFuncs = map[reflect.Type]UnmarshalFunc{
99
*(dest.(*time.Duration)) = duration
100
return nil
101
},
102
+ reflect.TypeOf((*scw.JSONObject)(nil)).Elem(): func(value string, dest interface{}) error {
103
+ jsonObject, err := scw.DecodeJSONObject(value, scw.NoEscape)
104
+ if err != nil {
105
+ return fmt.Errorf("failed to parse json object: %w", err)
106
+ }
107
+ *(dest.(*scw.JSONObject)) = jsonObject
108
+ return nil
109
+ },
110
}
111
112
// UnmarshalStruct parses args like ["arg1=1", "arg2=2"] to a Go structure using reflection.
0 commit comments