flagvar.go 289 B

123456789101112131415161718
  1. package flagvar
  2. import (
  3. "strings"
  4. )
  5. // StringVars []string implement flag.Value
  6. type StringVars []string
  7. func (s StringVars) String() string {
  8. return strings.Join(s, ",")
  9. }
  10. // Set implement flag.Value
  11. func (s *StringVars) Set(val string) error {
  12. *s = append(*s, val)
  13. return nil
  14. }