github.com/HashDataInc/packer@v1.3.2/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, strings.Split(value, ",")...) 15 return nil 16 }