YAML for Go, maintained by the YAML organization
open sourceApache-2.0 AND MITfree
go-yaml is the YAML library for Go now maintained by the YAML organization, continuing the archived original go-yaml repository that began at Canonical as part of Juju. It reads YAML into Go structs, maps and slices, works with nodes and comments, and writes YAML with explicit control over formatting. Version 4 adds Load and Dump APIs with options, plugins and version presets that restore v3 defaults, while v2 and v3 stay available at go.yaml.in/yaml/v2 and v3 with frozen APIs and security fixes only. The same pipeline is available as the go-yaml command.
Problems it solves
- read a YAML config file into a Go struct
- parse and write YAML in Go while keeping comments
- find a maintained replacement for the archived gopkg.in/yaml.v3
Features
- decode YAML into Go structs, maps, slices and custom types
- work with YAML nodes and comments
- Load and Dump APIs with options and plugins (v4)
- version presets that restore v3 defaults
- go-yaml command-line tool using the same pipeline
Alternatives
The same job
These do what go-yaml (yaml/go-yaml) does.
- ghodss/yaml Go YAML marshaling that reuses JSON struct tags, by converting YAML to JSON (unmaintained)
