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/3837/head
Erik Sundell 7 years ago
parent 50f6fddd99
commit 35132d141c

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