toYaml - Fixes #3470 - trailing \n issue

`toYaml` 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 6cdf6cee56)
release-2.9
Erik Sundell 8 years ago committed by Matthew Fisher
parent 4d51d22e07
commit 1dc32f7849
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -36,7 +36,7 @@ func ToYAML(s string) (string, error) {
return "", err
}
d, err := yaml.Marshal(m)
return string(d), err
return strings.TrimSuffix(string(d), "\n"), err
}
// Parse parses a set line.

Loading…
Cancel
Save