mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
b76b23e6ee
Fixes #2245
17 lines
330 B
Go
17 lines
330 B
Go
package main
|
|
|
|
import "strings"
|
|
|
|
// splitYaml splits a text file into separate yaml documents divided by ---
|
|
func splitYaml(in string) []string {
|
|
var out []string
|
|
for _, chunk := range yamlSeparator.Split(in, -1) {
|
|
chunk = strings.TrimSpace(chunk)
|
|
if chunk == "" {
|
|
continue
|
|
}
|
|
out = append(out, chunk)
|
|
}
|
|
return out
|
|
}
|