Skip to content

Commit f4d8eb8

Browse files
ndeloofglours
authored andcommitted
fix GetAsEqualsMap. An empty string means deleted
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 9412e7d commit f4d8eb8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

utils/stringutils.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ func StringToBool(s string) bool {
3232
func GetAsEqualsMap(em []string) map[string]string {
3333
m := make(map[string]string)
3434
for _, v := range em {
35-
kv := strings.SplitN(v, "=", 2)
36-
m[kv[0]] = kv[1]
35+
key, val, found := strings.Cut(v, "=")
36+
if found {
37+
m[key] = val
38+
}
3739
}
3840
return m
3941
}

0 commit comments

Comments
 (0)