Skip to content

v2.0.0

Latest

Choose a tag to compare

@sethvargo sethvargo released this 23 Sep 23:41
v2.0.0
f678e40

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 to github.com/sethvargo/go-envconfig/v2 and run go get github.com/sethvargo/go-envconfig/v2.
  • The legacy Decoder interface is removed. Implement DecoderCtx (EnvDecode(ctx context.Context, val string) error) instead. Types that still implement the old no-context EnvDecode(val string) error will no longer be detected as decoders. The built-in Base64Bytes and HexBytes types now use the context-aware signature.
  • LegacyMutatorFunc is removed. Use MutatorFunc directly.
  • Decoders no longer run on unset variables (#147). A decoder is invoked only when a value is present or decodeunset is 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