Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/6543/xyaml
Mirror of eXtend YAML
https://github.com/6543/xyaml
golang golang-library lib library mirror yaml yaml-parser
Last synced: 19 days ago
JSON representation
Mirror of eXtend YAML
- Host: GitHub
- URL: https://github.com/6543/xyaml
- Owner: 6543
- License: mit
- Created: 2023-04-28T16:41:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-03T19:22:44.000Z (over 1 year ago)
- Last Synced: 2024-10-29T08:05:01.941Z (2 months ago)
- Topics: golang, golang-library, lib, library, mirror, yaml, yaml-parser
- Language: Go
- Homepage: https://codeberg.org/6543/xyaml
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eXtend YAML
[![Tests](https://ci.codeberg.org/api/badges/6543/xyaml/status.svg)](https://ci.codeberg.org/6543/xyaml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![GoDoc](https://godoc.org/codeberg.org/6543/xyaml?status.svg)](https://godoc.org/codeberg.org/6543/xyaml)
[![Go Report Card](https://goreportcard.com/badge/codeberg.org/6543/xyaml)](https://goreportcard.com/report/codeberg.org/6543/xyaml)is a library to extend [`gopkg.in/yaml.v3`](https://github.com/go-yaml/yaml/tree/v3)
to allow merging [sequences](https://github.com/yaml/yaml/issues/48)## Features
- [x] merge sequences
- [x] single alias
- [x] array of alias## How to use
`go get codeberg.org/6543/xyaml`
and just replace your
```go
err := yaml.Unmarshal(in, out)
```with
```go
err := xyaml.Unmarshal(in, out)
```## Examples
### merge sequences
```yml
array1: &my_array_alias
- foo
- bararray2:
- <<: *my_array_alias
- NEW1
- <<: [*my_array_alias, *my_array_alias]
```will be interpreted as:
```yml
array1:
- foo
- bararray2:
- foo
- bar
- NEW1
- foo
- bar
- foo
- bar
```