1
0
Fork 0

Docker labels

This commit is contained in:
Ludovic Fernandez 2017-11-28 11:16:03 +01:00 committed by Traefiker
parent 101a4d0d8d
commit 4bdeb33ac1
8 changed files with 778 additions and 1237 deletions

View file

@ -5,15 +5,15 @@ import "strings"
// SplitAndTrimString splits separatedString at the comma character and trims each
// piece, filtering out empty pieces. Returns the list of pieces or nil if the input
// did not contain a non-empty piece.
func SplitAndTrimString(separatedString string) []string {
listOfStrings := strings.Split(separatedString, ",")
var trimmedListOfStrings []string
for _, s := range listOfStrings {
func SplitAndTrimString(base string) []string {
var trimmedStrings []string
for _, s := range strings.Split(base, ",") {
s = strings.TrimSpace(s)
if len(s) > 0 {
trimmedListOfStrings = append(trimmedListOfStrings, s)
trimmedStrings = append(trimmedStrings, s)
}
}
return trimmedListOfStrings
return trimmedStrings
}