toYaml - Fixes #3410 - trailing \n issue

`toYaml` utilized by `.Files` was introducing a new line. It is an issue since the new line is part of a functions output, it can't be whitespace chomped away so it would require a `trimSuffix "\n"` pipe. This commit trims one trailing `\n` from the toYaml output.
pull/4207/head^2
Erik Sundell 8 years ago
parent 67bfa60bc5
commit 3b30168569

@ -175,7 +175,7 @@ func ToYaml(v interface{}) string {
// Swallow errors inside of a template.
return ""
}
return string(data)
return strings.TrimSuffix(string(data), "\n")
}
// FromYaml converts a YAML document into a map[string]interface{}.

Loading…
Cancel
Save