For o bibliotecă de încărcare a configurațiilor pentru aplicații Go, the strongest matches are spf13/viper (Viper is the de facto standard Go library for), knadh/koanf (koanf is a Go configuration management library that loads) and joho/godotenv (It is a Go configuration library for loading environment). caarlos0/env and gookit/config round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
Aceste biblioteci oferă instrumente robuste pentru gestionarea setărilor aplicației, a variabilelor de mediu și a fișierelor de configurare în Go.
Viper is a configuration management library designed to centralize application settings from diverse sources into a unified, type-safe registry. It aggregates data from local files, environment variables, command-line flags, and remote key-value stores, providing a single source of truth for application state. By utilizing a hierarchical key-value registry, the system resolves configuration values based on a prioritized stack of providers, ranging from default values to runtime overrides. The library distinguishes itself through its pluggable provider abstraction and dynamic update capabiliti
Viper is the de facto standard Go library for loading configuration from files, environment variables, and command-line flags, covering format flexibility, defaults, live reload, and CLI integration, but it lacks built-in validation, which the search specifically requires.
koanf is a configuration management library for Go designed to load, merge, and unmarshal application settings from multiple sources into structured objects. It functions as a multi-source config loader that aggregates data from environment variables, files, and remote providers into a single unified map. The system utilizes a pluggable architecture for parsing and data abstraction, allowing it to transform bytes from formats such as JSON, YAML, and TOML into nested maps. It supports dynamic configuration watching to monitor external sources and trigger automatic reloads when settings change.
koanf is a Go configuration management library that loads settings from files, environment variables, and remote sources with support for YAML/JSON/TOML and automatic hot reloading, though it lacks built-in validation and command-line flag integration.
godotenv is a Go library designed to load, parse, and serialize environment configuration files. It provides tools to extract configuration data from files into maps and inject those key-value pairs directly into the system environment of a Go application process. The project includes a configuration file serializer for exporting environment variable maps back into formatted files and a parser for extracting data without modifying the system environment. It supports injecting variables from strings or files into the process environment using priority-based overloading and overwriting. The li
It is a Go configuration library for loading environment variables from dotenv files, which fits the category, but it lacks support for YAML/JSON/TOML, validation, live reload, and CLI flag integration that the search requires.
env is a Go library that reads environment variables and populates the fields of a Go struct according to tag directives. It uses reflection to iterate over struct types and tags at runtime, mapping environment variable names to struct fields and applying parsing behavior defined in struct tags. The library supports required field validation, returning errors when marked fields are missing or empty after parsing. It also provides default value fallback from struct tags when environment variables are not set, environment variable expansion that recursively substitutes references within values,
env is a Go library that loads configuration specifically from environment variables into structs with defaults and validation, but it does not support file-based config (YAML/JSON/TOML), command-line flags, or live reload, so it covers only part of the requested scope.
📝 Go configuration manage(load,get,set,export). support JSON, YAML, TOML, Properties, INI, HCL, ENV and Flags. Multi file load, data override merge, parse ENV var. Go应用配置加载管理,支持多种格式,多文件加载,远程文件加载,支持数据合并,解析环境变量名
gookit/config is a Go configuration management library that supports loading from multiple formats (YAML, JSON, TOML, and others), environment variables, and command-line flags, directly matching the visitor's need for a Go config loading library.