A simple, opinionated Go library for loading configuration from defaults, files, environment variables, and command-line flags.
aconfig is a Go library for loading application configuration from multiple sources including code defaults, configuration files, environment variables, and command-line flags. It solves the problem of managing settings across different deployment environments with a clean, structured approach.
Go developers building applications that require flexible configuration management across different environments (development, staging, production).
Developers choose aconfig for its simplicity, opinionated design that reduces complexity, and seamless integration with Go's struct system without requiring external dependencies for core functionality.
Simple, useful and opinionated config loader.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The API is minimal and easy to implement, as shown in the example where loading configuration requires just a few lines of code with struct tags and a loader.
Supports loading from defaults, files (JSON, YAML, etc.), environment variables, and command-line flags in a specified order, providing flexibility for different deployment environments.
Uses struct tags to automatically map configuration values to fields, reducing boilerplate code and simplifying setup, as demonstrated in the MyConfig example.
The base library is dependency-free, with file parsers as optional submodules, keeping the footprint small and avoiding bloat for basic use cases.
Only supports basic tags like 'required' and 'default', lacking advanced validation such as custom rules, cross-field checks, or type coercion, which might require manual handling.
To use file formats like YAML or TOML, separate submodules must be imported (e.g., aconfigyaml), adding setup complexity and potential versioning issues compared to all-in-one solutions.
Does not natively support loading configuration from remote sources like databases, APIs, or cloud services, limiting its use in modern, cloud-native applications.