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
cannot merge Mapping into Anchor
Hi,
First of all, thank you for this amazing library.
I'm trying to merge 2 yamls, and getting error cannot merge Mapping into Anchor. I tried to search in the docs, and in repo to be in vein.
I'm getting started with golang. So can't crack very deep things 😬
Appreciate any help.
Code
package main import ( "fmt" "strings" "github.com/goccy/go-yaml" "github.com/goccy/go-yaml/parser" ) func main() { original := ` chalice: &chalice env: environment: dev cloud: AWS other: - hey - hello global: chalice: *chalice ` override := ` chalice: &chalice env: environment: production jwt_enabled: false global: chalice: *chalice ` orig, err := parser.ParseBytes([]byte(original), 0) if err != nil { fmt.Println("panic") panic(err) } path, err := yaml.PathString("$.chalice") if err != nil { panic(err) } err = path.MergeFromReader(orig, strings.NewReader(override)) if err != nil { panic(err) } }
error
❯ go run main.go panic: cannot merge Mapping into Anchor goroutine 1 [running]: main.main() /tmp/tmp_m/main.go:48 +0xc5 exit status 2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
First of all, thank you for this amazing library.
I'm trying to merge 2 yamls, and getting error
cannot merge Mapping into Anchor
. I tried to search in the docs, and in repo to be in vein.I'm getting started with golang. So can't crack very deep things 😬
Appreciate any help.
Code
error
The text was updated successfully, but these errors were encountered: