Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions string_to_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func newStringToStringValue(val map[string]string, p *map[string]string) *string
// Set updates the flag value from the given string, adding additional mappings or updating existing ones.
func (s *stringToStringValue) Set(val string) error {
var ss []string
// Support round-trip from String() output like [k=v] or [k=[]]
if strings.HasPrefix(val, "[") && strings.HasSuffix(val, "]") {
val = val[1 : len(val)-1]
}
n := strings.Count(val, "=")
switch n {
case 0:
Expand Down
Loading