Parse a YAML configuration file into a typed Go struct for use in your application.
Serialize Go data to YAML for human-readable configuration or output files.
Read existing YAML 1.1 config files that use yes/no or on/off as booleans without breaking compatibility.
Project is now unmaintained, the existing v3 release is stable but no new development is expected.
This is a Go library for reading and writing YAML. YAML is a text format commonly used in configuration files and data exchange, where you write key-value pairs and nested structures using indentation instead of curly braces or XML tags. This library lets Go programs convert YAML text into Go data structures and back. The package was originally developed at Canonical, the company behind Ubuntu, as part of the juju infrastructure project. It is built on a Go port of libyaml, a widely used C library for parsing YAML. The v3 release supports most of YAML 1.2 while keeping some older YAML 1.1 behaviors for compatibility with existing files, such as recognizing yes/no and on/off as boolean values when the destination type is a bool. To use it, you import the package path gopkg.in/yaml.v3, then call Unmarshal to parse YAML text into a Go struct or map, or Marshal to produce YAML from your data. The code example in the README shows a short YAML snippet being decoded into a typed struct, then marshaled back into YAML text. Note: the README states this project is now unmaintained. The original author, Gustavo Niemeyer, stopped active maintenance due to limited time and was unable to transfer the project to a larger organization. The repository remains available and the existing release is stable, but new development is not expected.
← go-yaml on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.