Unverified Commit 1dc32f78 authored by Erik Sundell's avatar Erik Sundell Committed by Matthew Fisher
Browse files

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 6cdf6cee)
No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
...@@ -36,7 +36,7 @@ func ToYAML(s string) (string, error) { ...@@ -36,7 +36,7 @@ func ToYAML(s string) (string, error) {
return "", err return "", err
} }
d, err := yaml.Marshal(m) d, err := yaml.Marshal(m)
return string(d), err return strings.TrimSuffix(string(d), "\n"), err
} }
// Parse parses a set line. // Parse parses a set line.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment