Given a struct field of type map[string][]string and env tag of SOMEVAR, how can one specify pairs in the environment variable?
I recommend use of a semicolon. e.g.:
export SOMEVAR='foo1:bar1,bar2;foo2:bar3;foo1:bar4'
should result in:
map[string][]string{
"foo1": []string{
"bar1",
"bar2",
"bar4",
},
"foo2": []string{
"bar3",
},
}
Currently, it would result in:
map[string][]string{
"foo1": []string{
"bar1,bar2;foo2:bar3;foo1:bar4",
},
}
Likewise, specifying (assuming short:"m"):
-m "foo1:bar1,bar2" -m "foo2:bar3,bar4" -m "foo1:bar5"
currently would result in:
map[string][]string{
"foo1": []string{
"bar5",
},
"foo2": []string{
"bar3,bar4",
},
}
instead of:
map[string][]string{
"foo1": []string{
"bar1",
"bar2",
"bar5",
},
"foo2": []string{
"bar3",
"bar4",
},
}
Which is also clearly incorrect.
Given a struct field of type
map[string][]stringandenvtag ofSOMEVAR, how can one specify pairs in the environment variable?I recommend use of a semicolon. e.g.:
export SOMEVAR='foo1:bar1,bar2;foo2:bar3;foo1:bar4'should result in:
Currently, it would result in:
Likewise, specifying (assuming
short:"m"):-m "foo1:bar1,bar2" -m "foo2:bar3,bar4" -m "foo1:bar5"currently would result in:
instead of:
Which is also clearly incorrect.