var.go 302 B

1234567891011121314151617181920
  1. package args
  2. import (
  3. "strings"
  4. )
  5. // StringSliceVar is
  6. type StringSliceVar []string
  7. func (v StringSliceVar) String() string {
  8. return strings.Join(v, ",")
  9. }
  10. // Set is
  11. func (v *StringSliceVar) Set(in string) error {
  12. for _, a := range strings.Split(in, ",") {
  13. *v = append(*v, a)
  14. }
  15. return nil
  16. }