Repository navigation
2.0.0: New Prefix Support
馃挜 BREAKING CHANGES 馃挜
This release includes breaking changes to the way prefixes are supported, as well as slight adjustments to several method names.
- Removed
*Envsuffix from some namesWithLookupEnvis now namedWithLookupMapLookupEnvis now namedMapLookupCompositeLookupEnvis now namedCompositeLookup
- Removed
WithPrefix,WithPrefixHandling,SetPrefix, andNewWithPrefix.// OLD vary.New(vary.WithPrefix("MYAPP")) // or vary.New(vary.WithPrefix("MYAPP"), vary.WithPrefixHandling(vary.PrefixHandlingPrimary)) // NEW vary.New(vary.WithLookup( vary.CompositeLookup(vary.PrefixedLookup("MYAPP_", os.LookupEnv), os.LookupEnv)))
// OLD vary.New(vary.WithPrefix("MYAPP"), vary.WithPrefixHandling(vary.PrefixHandlingSecondary)) // NEW vary.New(vary.WithLookup( vary.CompositeLookup(os.LookupEnv, vary.PrefixedLookup("MYAPP_", os.LookupEnv))))
// OLD vary.New(vary.WithPrefix("MYAPP"), vary.WithPrefixHandling(vary.PrefixHandlingAlways)) // NEW vary.New(vary.WithLookup(vary.PrefixedLookup("MYAPP_", os.LookupEnv)))
- Notice the explicit inclusion of the trailing underscore (
_) in the new code, as the underscore is no longer automatically inserted when usingPrefixedLookupin order to provide more flexibility.
- Notice the explicit inclusion of the trailing underscore (
What's Changed
- Eliminate some code redundancies by @chadweimer in #10
- Added CompositeLookupEnv to allow adding multiple lookups by @chadweimer in #11
- BREAKING: Changed prefix support to leverage LookupEnvFunc by @chadweimer in #12
Full Changelog: v1.3.1...v2.0.0