File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,19 @@ func setType(v reflect.Value, newValue string) error {
147147 name , value , _ := strings .Cut (newValue , "=" )
148148 v .SetMapIndex (reflect .ValueOf (name ), reflect .ValueOf (intstr .Parse (value )))
149149
150+ case "map[string][]string" :
151+ name , value , _ := strings .Cut (newValue , "=" )
152+ tokens := strings .Split (value , "," )
153+ valueArray := reflect .MakeSlice (reflect .TypeOf (tokens ), 0 , v .Len ()+ len (tokens ))
154+ for _ , s := range tokens {
155+ valueItem := reflect .New (reflect .TypeOf (s ))
156+ if err := setType (valueItem .Elem (), s ); err != nil {
157+ return err
158+ }
159+ valueArray = reflect .Append (valueArray , valueItem .Elem ())
160+ }
161+ v .SetMapIndex (reflect .ValueOf (name ), valueArray )
162+
150163 default :
151164 return fmt .Errorf ("unhandled type %q" , t )
152165 }
You can’t perform that action at this time.
0 commit comments