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.
This commit is contained in:
Erik Sundell 2018-04-06 00:41:14 +02:00
parent 35132d141c
commit 6cdf6cee56
1 changed files with 1 additions and 1 deletions

View File

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