Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. toml

toml

MITGov1.6.0

A TOML parser for Go with reflection, compatible with TOML v1.1.0 and offering a CLI validator tool.

GitHubGitHub
5.0k stars568 forks0 contributors

What is toml?

BurntSushi/toml is a Go library for parsing and generating TOML configuration files. It provides a reflection-based interface similar to Go's standard json and xml packages, enabling seamless integration with Go structs for configuration management. The library fully supports TOML v1.1.0 and includes a CLI validator tool for checking file correctness.

Target Audience

Go developers who need to read or write TOML configuration files in their applications, particularly those seeking an idiomatic, standard-library-like approach. It's also useful for DevOps engineers or tool authors who require a reliable TOML parser and validator within Go-based tools.

Value Proposition

Developers choose this library because it offers a minimal, obvious API that integrates naturally with Go's ecosystem, mirroring the familiar patterns of encoding/json. Its full TOML v1.1.0 compliance and included CLI validator provide reliability and convenience not always found in alternatives.

Overview

TOML parser for Golang with reflection.

Use Cases

Best For

  • Parsing TOML configuration files into Go structs with reflection-based mapping.
  • Generating TOML from Go structs for configuration serialization.
  • Validating TOML files for syntax correctness using the included tomlv CLI tool.
  • Handling custom data types in TOML via encoding.TextUnmarshaler or UnmarshalTOML interfaces.
  • Managing configuration in Go projects where struct tags are needed for key-field mapping.
  • Ensuring compatibility with the latest TOML v1.1.0 specification in Go applications.

Not Ideal For

  • Projects not using Go, as this is a language-specific library with no cross-platform support.
  • High-performance applications where reflection overhead could bottleneck parsing or serialization speed.
  • Environments stuck on Go versions older than 1.18, due to its minimum version requirement.
  • Scenarios requiring fine-grained control over TOML parsing without reflection, such as custom lexer/parser implementations.

Pros & Cons

Pros

Standard-Library Familiarity

Uses a reflection interface identical to Go's json and xml packages, making it instantly familiar to developers and reducing the learning curve.

Full TOML v1.1.0 Compliance

Supports the latest TOML specification, ensuring reliable parsing and generation without compatibility issues for modern features.

Built-in CLI Validator

Includes the tomlv tool for command-line validation of TOML files, adding convenience for testing and debugging configurations.

Flexible Custom Unmarshaling

Allows integration with encoding.TextUnmarshaler and custom UnmarshalTOML interfaces, enabling handling of complex types like email addresses as demonstrated in the README.

Cons

Reflection Performance Overhead

The reflection-based decoding, while convenient, can be slower than optimized, direct parsers, making it less suitable for latency-sensitive applications.

Exported Fields Limitation

Only exported struct fields are processed, as noted in the README, which can complicate scenarios involving private or internal data structures.

Go Version Lock-in

Requires Go 1.18 or newer, potentially excluding legacy projects or environments with strict version constraints.

Frequently Asked Questions

Quick Stats

Stars5,026
Forks568
Contributors0
Open Issues20
Last commit2 months ago
CreatedSince 2013

Tags

#go-library#cli-tool#configuration#serialization#reflection#go#toml-parser#config-management

Built With

G
Go

Included in

Go169.1k
Auto-fetched 1 day ago

Related Projects

blackfridayblackfriday

Blackfriday: a markdown processor for Go

Stars5,593
Forks598
Last commit2 years ago
goldmarkgoldmark

:trophy: The Golden Swiss Army Knife for markdown processing. 100% CommonMark compliant, AST w/ CST, Extensible, Fast, CJK-friendly.

Stars5,071
Forks328
Last commit2 days ago
html-to-markdownhtml-to-markdown

⚙️ Convert HTML to Markdown. Even works with entire websites and can be extended through rules.

Stars3,836
Forks229
Last commit2 months ago
go-tomlgo-toml

Go library for the TOML file format

Stars1,998
Forks259
Last commit2 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub