Skip to content

6543/xyaml

Repository files navigation

eXtend YAML

Tests License: MIT GoDoc Go Report Card

Get it on Codeberg

is a library to extend gopkg.in/yaml.v3 to allow merging sequences

Features

  • merge sequences
    • single alias
    • array of alias

How to use

go get codeberg.org/6543/xyaml

and just replace your

err := yaml.Unmarshal(in, out)

with

err := xyaml.Unmarshal(in, out)

Examples

merge sequences

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