mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
pkg/flags: fix "Set"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
3b1eaaee6e
commit
089e8ffecb
@ -30,6 +30,7 @@ type UniqueStringsValue struct {
|
||||
// Implements "flag.Value" interface.
|
||||
// The values are set in order.
|
||||
func (us *UniqueStringsValue) Set(s string) error {
|
||||
us.Values = make(map[string]struct{})
|
||||
for _, v := range strings.Split(s, ",") {
|
||||
us.Values[v] = struct{}{}
|
||||
}
|
||||
|
@ -46,6 +46,8 @@ func (us *UniqueURLs) Set(s string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
us.Values = make(map[string]struct{})
|
||||
us.uss = make([]url.URL, 0)
|
||||
for _, v := range ss {
|
||||
us.Values[v.String()] = struct{}{}
|
||||
us.uss = append(us.uss, v)
|
||||
|
Loading…
x
Reference in New Issue
Block a user