Simple, extremely lightweight, extensible, configuration management library for Go. Support for JSON, TOML, YAML, env, command line, file, S3 etc. Alternative to viper.
Full Changelog: https://github.com/knadh/koanf/compare/v2.1.0...v2.1.1
https://github.com/mitchellh/mapstructure/issues/349#issuecomment-1860372162 is discontinued and koanf has switched to using the fork github.com/go-viper/mapstructure/v2
.
If you are referencing the mapstructure lib in your code (custom DecoderConfig), you have to switch the paths to the above forked version of mapstructure
lib.
github.com/mitchellh/mapstructure
-> github.com/go-viper/mapstructure/v2
Full Changelog: https://github.com/knadh/koanf/compare/v2.0.2...v2.1.0
https://github.com/mitchellh/mapstructure/issues/349#issuecomment-1860372162 is discontinued and koanf has switched to using the fork github.com/go-viper/mapstructure/v2
.
If you are referencing the mapstructure lib in your code (custom DecoderConfig), you have to switch the paths to the above forked version of koanf.
github.com/mitchellh/mapstructure
=> github.com/go-viper/mapstructure/v2
Opt{}
param that takes a koanf instance to match posflag's default value behaviour in basic flag. Closes #255. by @knadh in https://github.com/knadh/koanf/pull/259
Full Changelog: https://github.com/knadh/koanf/compare/v2.0.1...v2.0.2
Full Changelog: https://github.com/knadh/koanf/compare/v2.0.0...v2.0.1
This is a major breaking change that ends koanf v1 (v1.5.0) and moves to v2. Continued usage of v1 is unaffected. While koanf does not bundle external dependencies into its core thereby avoiding them in the build, a go get
would still pull them and go.mod, bringing in unnecessary references as all the providers and parsers were "sub" packages of the main module.
This PR upgrades koanf to v2 and separates every single provider and parser package into its own module, go.mod, and release tag (eg: providers/yaml/v0.1.0
). That is, one-repository, many modules. This removes references to all indirect dependencies in the main koanf package significantly de-cluttering it.
github.com/knadh/koanf/v2
.go get github.com/knadh/koanf/providers/s3
, go get github.com/knadh/koanf/parsers/json
etc.Full Changelog: https://github.com/knadh/koanf/compare/v1.5.0...v2.0.0
Set(key, val)
shorthand for Merge()
. by @knadh in https://github.com/knadh/koanf/pull/192
Full Changelog: https://github.com/knadh/koanf/compare/v1.4.5...v1.5.0
Full Changelog: https://github.com/knadh/koanf/compare/v1.4.4...v1.4.5
Full Changelog: https://github.com/knadh/koanf/compare/v1.4.3...v1.4.4
FlagVal
by @muXxer in https://github.com/knadh/koanf/pull/147
Full Changelog: https://github.com/knadh/koanf/compare/v1.4.1...v1.4.2
Full Changelog: https://github.com/knadh/koanf/compare/v1.4.0...v1.4.1