1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

Refactor to use libcompose

This commit is contained in:
Darren Shepherd
2015-08-04 14:45:38 -07:00
parent 19f9a1b281
commit 9d76b79ac3
26 changed files with 665 additions and 1458 deletions

View File

@@ -345,3 +345,16 @@ func KVPairs2Map(kvs []string) map[string]string {
}
return r
}
func TrimSplitN(str, sep string, count int) []string {
result := []string{}
for _, part := range strings.SplitN(strings.TrimSpace(str), sep, count) {
result = append(result, strings.TrimSpace(part))
}
return result
}
func TrimSplit(str, sep string) []string {
return TrimSplitN(str, sep, -1)
}