liveBook · Manning

Github.com/kylelemons/go-gypsy/yaml

As explained in Go in Practice, Second Edition

github.com/kylelemons/go-gypsy/yaml is a Go package for reading, accessing, converting, and writing YAML data.

github.com/kylelemons/go-gypsy/yaml provides a practical way for Go applications to read YAML configuration from files, access values, coerce types, and produce YAML output. section 2.2.1

Read typed configuration

Load a configuration with yaml.ReadFile, retrieve a string with Get, and retrieve a Boolean with GetBool. Check each returned error and return early when a required setting is missing. section 2.2.1

How Go in Practice, Second Edition covers it

How deep it goes
Demonstrates file loading, key access, type coercion, and error handling without detailing the parser internals.
Examples
Uses conf.yaml with path and enabled keys, then prints both retrieved values.
What it assumes
Assumes basic Go program structure, imports, variables, and error handling while demonstrating YAML access directly.
What you can do after
Operate/configure a Go application by loading YAML files and retrieving required string and Boolean settings.
How it connects
Connects YAML configuration with typed values, error handling, JSON configuration, and INI configuration.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Go in Practice, Second Edition. The section links point to the parts of the book it draws on.