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.

(cherry picked from commit 35132d141c)
release-2.9
Erik Sundell 8 years ago committed by Matthew Fisher
parent 1dc32f7849
commit 9d81cc0971
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -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