go-common/app/tool/gengo/args/var.go

21 lines
302 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package args
import (
"strings"
)
// StringSliceVar is
type StringSliceVar []string
func (v StringSliceVar) String() string {
return strings.Join(v, ",")
}
// Set is
func (v *StringSliceVar) Set(in string) error {
for _, a := range strings.Split(in, ",") {
*v = append(*v, a)
}
return nil
}