Skip to content

Commit

Permalink
Merge pull request #106 from flanksource/change-keval
Browse files Browse the repository at this point in the history
chore: change key value to slice behavior
  • Loading branch information
yashmehrotra authored Mar 7, 2024
2 parents dd09bfc + c60535e commit fa1b95f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions collections/maps.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ func KeyValueSliceToMap(in []string) map[string]string {
for _, item := range in {
splits := strings.SplitN(item, "=", 2)
if len(splits) == 1 {
continue // ignore this item. not in a=b format
// For no keys, we add an empty string to match just the key
splits = append(splits, "")
}

sanitized[strings.TrimSpace(splits[0])] = strings.TrimSpace(splits[1])
}

return sanitized
}

Expand Down

0 comments on commit fa1b95f

Please sign in to comment.