mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
16 lines
330 B
Go
16 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
|
|
}
|