Open
Description
Hello,
consider the following new test case added to TestPath_Replace:
{
path: "$.a.a1",
dst: `
a: &a-anchor
a1: foo
b: *a-anchor
`,
src: `bar`,
expected: `
a: &a-anchor
a1: bar
b: *a-anchor
`,
it fails with a long stacktrace for the 3 subtests "WithReader", "WithFile" and "WithNode". Here is a shortened version:
=== RUN TestPath_Replace/$.a.a1/WithNode
path_test.go:578: failed to replace node by path ( $.a.a1 ):
github.com/goccy/go-yaml.(*Path).ReplaceWithNode
- failed to replace:
github.com/goccy/go-yaml.(*rootNode).replace
- failed to replace map value:
github.com/goccy/go-yaml.(*selectorNode).replace
- failed to replace:
github.com/goccy/go-yaml.(*selectorNode).replaceMapValue
- expected node type is map or map value. but got Anchor:
github.com/goccy/go-yaml.(*selectorNode).replace
- invalid query:
github.com/goccy/go-yaml.init
I have a partial fix, but the problem is that somehow some newlines are not printed. See PR #299.