We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Even if they are not part of a literal string, trailing newlines are systematically added to the string
foo: | bar # ↑↑↑ Note the two newlines right after the literal string
In this siituation, the bar value will be "bar\n\n" instead of "bar\n".
bar
"bar\n\n"
"bar\n"
Note that this also applies with strip sign |-
|-
Here is a simple reproduction case:
package main import ( "fmt" goYaml "github.com/goccy/go-yaml" ) func main() { yml := ` foo: |- bar ` var vmap[string]any goYaml.Unmarshal([]byte(yml), &v) fmt.Println(v["foo"]) // -> "bar\n\n" }
And a related playground: https://go.dev/play/p/XG6oCnbwwiz
The text was updated successfully, but these errors were encountered:
Partially fixed by #421 :)
Now, additional trailing lines only occurs without the strip (-) indicator.
-
@zoncoen may i ask you some help on this ?
Sorry, something went wrong.
No branches or pull requests
Even if they are not part of a literal string, trailing newlines are systematically added to the string
In this siituation, the
bar
value will be"bar\n\n"
instead of"bar\n"
.Note that this also applies with strip sign
|-
Here is a simple reproduction case:
And a related playground: https://go.dev/play/p/XG6oCnbwwiz
The text was updated successfully, but these errors were encountered: