Skip to content

Releases: sethvargo/go-envconfig

v1.1.0

06 Jul 16:48
v1.1.0
bbaf784
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.3...v1.1.0

v1.0.3

18 May 19:25
v1.0.3
e51a54f
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.2...v1.0.3

v1.0.2

16 May 21:19
v1.0.2
4970c73
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.0.1...v1.0.2

v1.0.1

06 Mar 02:32
v1.0.1
bec89e0
Compare
Choose a tag to compare

What's Changed

  • Update Go version to 1.22.1 (security)

v1.0.0

07 Jan 19:41
v1.0.0
Compare
Choose a tag to compare

Caution

This release includes breaking changes. Please read these release notes thoroughly.

New features

  • Introduce global and cascading configuration options by @sethvargo in #97

    This introduces the concept of global configurations and cascades struct-level configuration options onto all child fields. For example, marking a struct as required will mark all child fields as required. Similarly, setting a custom delimiter on a struct tag propagates that delimiter to all child fields of the struct. This behavior previously only applied to the noinit tag, but it now applies to all tags.

Breaking changes

  • Change MutatorFunc to be more flexible by @sethvargo in #92 and #94

    ⚠️ BREAKING! This changes the signature of the MutatorFunc to have more information about prior states. It will include the original environment variable names and values, as well as the currently resolved values. Additionally, the mutation chain can now be stopped without returning an error.

  • Require Go 1.21 or later by @sethvargo in #93

    ⚠️ BREAKING! The new minimum required Go version is 1.21.

  • Drop ExtractDefaults functionality by @sethvargo in #95

    ⚠️ BREAKING! This removes the ExtractDefaults function. It was rarely used and resulted in extraneous processing. Users who depended on this functionality can call ProcessWith an empty MapLookuper (which is all ExtractDefaults did anyway).

  • Ignore prefix computing environment variable defaults by @sethvargo in #99

    ⚠️ BREAKING! Computing the default value for an environment variable when the default value is another environment variable will ignore any prefixes on the current lookuper. See #85 for more information.

  • Allow configurable decoding by @sethvargo in #100

    ⚠️ BREAKING! Envconfig no longer runs decoders or mutators on unset values. To restore the old behavior, add the decodeunset struct field annotation or pass the DefaultDecodeUnset configuration option as true. See #100 for more information.

Full Changelog: v0.9.0...v1.0.0-beta1

v1.0.0-beta1

27 Dec 22:35
ee3f51d
Compare
Choose a tag to compare
v1.0.0-beta1 Pre-release
Pre-release

This is now released as v1.0.0. There are no changes between v1.0.0 and this release.

v0.9.0

14 Feb 03:00
c095b9c
Compare
Choose a tag to compare

What's Changed

  • Allow noinit to apply to slices, maps, and unsafe pointers by @sethvargo in #83

Full Changelog: v0.8.3...v0.9.0

v0.8.2

08 Aug 14:36
v0.8.2
00d8c81
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.8.1...v0.8.2

v0.8.1

27 Jul 18:04
v0.8.1
ce31e42
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.8.0...v0.8.1

v0.8.0

14 Jul 02:15
v0.8.0
1a03b30
Compare
Choose a tag to compare

What's Changed

The previous implementation of overwrite would always overwrite values in the given struct, even if values existed. While this is the definition of overwrite, it unintentionally extended to default values as well. So even if a value was explicitly set on a struct, it would be overwritten with the "default" value set in envconfig. This was an unexpected behavior, since defaults should take the lowest precedence.

The new implementation has the following behavior with overwrite:

  • If the struct field has the zero value and a default is set:

    • If no environment variable is specified, the struct field will be populated with the default value.

    • If an environment variable is specified, the struct field will be populate with the environment variable value.

  • If the struct field has a non-zero value and a default is set:

    • If no environment variable is specified, the struct field's existing value will be used (the default is ignored).

    • If an environment variable is specified, the struct field's existing value will be overwritten with the environment variable value.

As part of this change, decoder interfaces are only processed when an environment (or a default) is present.

Full Changelog: v0.7.0...v0.8.0