Decoding
- Decode into a type tagged for encoding/json with UseJSONTags. Without it, the json tags name nothing, and the decode returns no error.
- Catch a typo in a configuration file with DisallowUnknownField, and read the line and column off the error.
- Check each struct as the decoder fills it with Validator, and get the error back at the line that holds the bad value.
- Read a multi-document stream one document at a time with NewDecoder, go on past a document that fails, and stop where the stream cannot be read.
- Merge shared defaults with “«”, which the YAML 1.2 default does not do, and choose whether aliases share one Go value.
- Decode a document of unknown shape and write it back with its keys in the author’s order, with UseOrderedMap and MapSlice.
- Decode a value written in its own notation with UnmarshalYAML, and a type you do not own with CustomUnmarshaler or RegisterCustomUnmarshaler.