# go-yaml/yaml

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/go-yaml-yaml).**

7,023 stars · 1,108 forks · Go · NOASSERTION · archived

## Links

- GitHub: https://github.com/go-yaml/yaml
- awesome-repositories: https://awesome-repositories.com/repository/go-yaml-yaml.md

## Description

This library is a YAML encoder and decoder for native Go data structures. It provides the tools necessary to transform internal data into YAML formatted text and convert YAML input streams back into structured data.

The parser includes built-in protections against resource exhaustion attacks by enforcing limits on document depth and alias resolution. It also ensures deterministic output by employing consistent key sorting for maps.

The project covers serialization and deserialization workflows, including struct mapping and custom marshaling interfaces. It also handles input encoding detection and strict field validation during the decoding process.

## Tags

### Part of an Awesome List

- [YAML Processing](https://awesome-repositories.com/f/awesome-lists/data/yaml-processing.md) — Provides a complete system for decoding YAML encoded bytes or streams into native Go data structures. ([source](https://github.com/go-yaml/yaml#readme))
- [Configuration Management](https://awesome-repositories.com/f/awesome-lists/devtools/configuration-management.md) — YAML parsing library.
- [JSON and Data Serialization](https://awesome-repositories.com/f/awesome-lists/devtools/json-and-data-serialization.md) — Library for encoding and decoding YAML data structures.

### Data & Databases

- [YAML Parsers](https://awesome-repositories.com/f/data-databases/data-serialization-formats/data-formats/yaml-parsers.md) — Implements a complete library for encoding and decoding YAML data into native Go data structures.
- [Resource-Constrained Parsing](https://awesome-repositories.com/f/data-databases/data-serialization-formats/data-formats/yaml-parsers/resource-constrained-parsing.md) — Provides a YAML decoder with built-in protections against DoS attacks via depth and alias limits.
- [Interface-Based Marshaling](https://awesome-repositories.com/f/data-databases/data-type-definitions/scalar-types/custom-scalar-marshaling/interface-based-marshaling.md) — Allows custom types to define their own encoding logic by implementing standard marshaler interfaces.
- [YAML-to-Object Mapping](https://awesome-repositories.com/f/data-databases/sql-query-interfaces/object-to-object-mappers/yaml-to-object-mapping.md) — Maps YAML data to typed Go structs using inline annotations to link keys to embedded types. ([source](https://github.com/go-yaml/yaml/blob/v3/example_embedded_test.go))

### Software Engineering & Architecture

- [YAML Configuration Files](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/configuration-formats-and-schemas/yaml-configuration-files.md) — Enables the reading and validation of YAML configuration files to initialize application settings in Go.
- [Data Serialization Formats](https://awesome-repositories.com/f/software-engineering-architecture/data-serialization-formats.md) — Provides workflows for converting complex Go data structures into standardized YAML for storage or transmission.
- [Deserialization Depth Limiting](https://awesome-repositories.com/f/software-engineering-architecture/generic-type-definitions/generic-type-resolution/recursive-type-resolution/recursive-data-generators/recursion-depth-tracking/deserialization-depth-limiting.md) — Provides security-driven limits on the nesting level of objects during deserialization to prevent resource exhaustion attacks.
- [Reflection-Based Map Mapping](https://awesome-repositories.com/f/software-engineering-architecture/metadata-attachments/struct-tags/reflection-based-map-mapping.md) — Employs language reflection and struct tags to dynamically map YAML keys to typed Go struct fields.

### Development Tools & Productivity

- [Deterministic Serialization](https://awesome-repositories.com/f/development-tools-productivity/project-configuration/automated-config-generation/deterministic-serialization.md) — Produces consistently ordered YAML output from maps to ensure stable version control diffs and predictable exports.

### Security & Cryptography

- [Document Security Limits](https://awesome-repositories.com/f/security-cryptography/request-size-limiters/request-limiters/document-security-limits.md) — Parses untrusted YAML input while enforcing strict limits on document depth and aliases to prevent resource exhaustion.
- [Computational Resource Protections](https://awesome-repositories.com/f/security-cryptography/tcp-state-exhaustion-attacks/computational-resource-protections.md) — Protects against denial-of-service attacks by enforcing maximum limits on document depth and alias counts. ([source](https://github.com/go-yaml/yaml/blob/v3/limit_test.go))

### Web Development

- [Key Sorting](https://awesome-repositories.com/f/web-development/key-sorting.md) — Ensures deterministic YAML output by consistently sorting map keys regardless of their types. ([source](https://github.com/go-yaml/yaml/blob/v3/sorter.go))
