forked from Ivasoft/traefik
Docker labels
This commit is contained in:
committed by
Traefiker
parent
101a4d0d8d
commit
4bdeb33ac1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user