We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91cea07 commit 85348ffCopy full SHA for 85348ff
1 file changed
client/v2/autocli/flag/maps/generic.go
@@ -29,15 +29,15 @@ func (gm *genericMapValue[K, V]) Set(val string) error {
29
ss := strings.Split(val, ",")
30
out := make(map[K]V, len(ss))
31
for _, pair := range ss {
32
- kv := strings.SplitN(pair, "=", 2)
33
- if len(kv) != 2 {
+ key, value, found := strings.Cut(pair, "=")
+ if !found {
34
return fmt.Errorf("%s must be formatted as key=value", pair)
35
}
36
- key, err := gm.Options.keyParser(kv[0])
+ parsedKey, err := gm.Options.keyParser(key)
37
if err != nil {
38
return err
39
40
- out[key], err = gm.Options.valueParser(kv[1])
+ out[parsedKey], err = gm.Options.valueParser(value)
41
42
43
0 commit comments