added utils to flagset

This commit is contained in:
A.Unger
2020-01-15 11:24:26 +01:00
parent a628356fe8
commit e3e2e4127d

14
pkg/flagset/utils.go Normal file
View File

@@ -0,0 +1,14 @@
package flagset
import "strings"
// ParseAppsFlag transforms a string of the format "a, b, c" into []string{"a", "b", "c"}
func ParseAppsFlag(src string) []string {
var apps []string
parsed := strings.Split(src, ",")
for _, v := range parsed {
apps = append(apps, strings.TrimSpace(v))
}
return apps
}