The yaml package enables Go programs to comfortably encode and decode YAML
values. It was developed within Canonical as
part of the juju project, and is based on a
pure Go port of the well-known libyaml
C library to parse and generate YAML data quickly and reliably.
The yaml package supports most of YAML 1.1 and 1.2, including support for
anchors, tags, map merging, etc. Multi-document unmarshalling is not yet
implemented, and base-60 floats from YAML 1.1 are purposefully not
supported since they’re a poor design and are gone in YAML 1.2.
Installation and usage
The import path for the package is gopkg.in/yaml.v2.
To install it, run:
go get gopkg.in/yaml.v2
If opened in a browser, the import path itself leads to the API documentation: