This is the first v2 release. It changes the module path and removes deprecated APIs, so it requires code changes to adopt.
Breaking changes
- Module path is now
/v2. Update imports togithub.com/sethvargo/go-envconfig/v2and rungo get github.com/sethvargo/go-envconfig/v2. - The legacy
Decoderinterface is removed. ImplementDecoderCtx(EnvDecode(ctx context.Context, val string) error) instead. Types that still implement the old no-contextEnvDecode(val string) errorwill no longer be detected as decoders. The built-inBase64BytesandHexBytestypes now use the context-aware signature. LegacyMutatorFuncis removed. UseMutatorFuncdirectly.- Decoders no longer run on unset variables (#147). A decoder is invoked only when a value is present or
decodeunsetis set.
What's Changed
- Respect existing decoder values without overwrite by @sethvargo in #146
- Fix the escaped-backslash default example in the README by @sethvargo in #151
- Don't stop the mutator chain after a legacy mutator by @sethvargo in #150
- Reject field and element kinds that cannot be decoded by @sethvargo in #153
- Apply an empty value when overwriting by @sethvargo in #152
- Apply mutators and name errors on struct-decoder fields by @sethvargo in #148
- Don't run decoders on unset variables (breaking) by @sethvargo in #147
- Bump module path to /v2 for the v2.0.0 release by @sethvargo in #154
Full Changelog: v1.4.3...v2.0.0