is a library to extend gopkg.in/yaml.v3
to allow merging sequences
- merge sequences
- single alias
- array of alias
go get codeberg.org/6543/xyaml
and just replace your
err := yaml.Unmarshal(in, out)
with
err := xyaml.Unmarshal(in, out)
array1: &my_array_alias
- foo
- bar
array2:
- <<: *my_array_alias
- NEW1
- <<: [*my_array_alias, *my_array_alias]
will be interpreted as:
array1:
- foo
- bar
array2:
- foo
- bar
- NEW1
- foo
- bar
- foo
- bar