github.com/mattyr/nomad@v0.3.3-0.20160919021406-3485a065154a/helper/flag-slice/flag.go (about) 1 package sliceflag 2 3 import "strings" 4 5 // StringFlag implements the flag.Value interface and allows multiple 6 // calls to the same variable to append a list. 7 type StringFlag []string 8 9 func (s *StringFlag) String() string { 10 return strings.Join(*s, ",") 11 } 12 13 func (s *StringFlag) Set(value string) error { 14 *s = append(*s, value) 15 return nil 16 }