A Go library for managing 12-factor application configuration as a typesafe struct with minimal code.
Config is a Go library that enables developers to manage application configuration as a typesafe struct with minimal boilerplate. It automatically binds environment variables and configuration file values to Go struct fields, following 12-factor app principles for cloud-native applications. The library handles type conversions, error aggregation, and supports multiple configuration sources.
Go developers building cloud-native applications, microservices, or any project requiring robust, environment-based configuration management. It's particularly useful for teams adhering to 12-factor app methodology.
Developers choose Config for its simplicity, minimal code footprint, and strict adherence to standard library conventions. Unlike heavier configuration libraries, it focuses solely on binding without extra dependencies, making it lightweight and predictable for production use.
12 factor configuration as a typesafe struct in as little as two function calls
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically converts environment variables to appropriate Go types using standard library functions like strconv, ensuring type safety without manual parsing errors.
Configures applications in as little as two function calls, with the entire library under 180 lines of code and no external dependencies, reducing bloat.
Allows merging multiple configuration sources (e.g., files and env vars) with later values overriding earlier ones, facilitating flexible development and deployment workflows.
Collects all conversion errors into a single error value, making it easier to debug configuration issues without stopping at the first failure.
Does not support slices of structs or maps, as admitted in the README, restricting use for dynamic or complex configuration hierarchies.
Focuses solely on binding values to structs, leaving validation to the user, which requires additional code for robust configuration checks.
Uses double underscores (e.g., PARENT__CHILD) for nested struct mapping, which can be error-prone and less intuitive compared to dot notation or other conventions.