2
0
mirror of https://github.com/status-im/consul.git synced 2025-02-12 13:46:46 +00:00
2017-06-20 12:52:35 -07:00

21 lines
411 B
Go

package configutil
import "strings"
// AppendSliceValue implements the flag.Value interface and allows multiple
// calls to the same variable to append a list.
type AppendSliceValue []string
func (s *AppendSliceValue) String() string {
return strings.Join(*s, ",")
}
func (s *AppendSliceValue) Set(value string) error {
if *s == nil {
*s = make([]string, 0, 1)
}
*s = append(*s, value)
return nil
}