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.
pull/3837/head
Erik Sundell 7 years ago
parent 35132d141c
commit 6cdf6cee56

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

Loading…
Cancel
Save