BurntSushi / toml
TOML parser for Golang with reflection.
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing BurntSushi/toml in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewTOML stands for Tom's Obvious, Minimal Language. This Go package provides a reflection interface similar to Go's standard library and packages. Compatible with TOML version v1.1.0. Documentation: https://pkg.go.dev/github.com/BurntSushi/toml See the releases page for a changelog; this information is also in the git tag annotations (e.g. ). This library requires Go 1.18 or newer; add it to your go.mod with: % go get github.com/BurntSushi/toml@latest It also comes with a TOML validator CLI tool: % go install github.com/BurntSushi/toml/cmd/tomlv@latest % tomlv some-toml-file.toml Examples For the simplest example, consider some TOML file as just a list of keys and values: Which can be decoded with: You can also use struct tags if your struct field name doesn't map to a TOML key value directly: Beware that like other decoders **only exported fields** are considered when encoding and decoding; private fields are silently ignored. Using the and interfaces Here's an example that automatically parses values in a : Can be decoded with: To target TOML specifically you can implement TOML interface in a similar way. More complex usage See the directory for a more complex example.