Env Versions Save

A simple and zero-dependencies library to parse environment variables into structs

v10.0.0

6 months ago

Changelog

New Features

  • 62b4ae1b184f2fcdfaba263e66bb1d37e4bfcda5: feat!: ParseWithOptions: add the ability to override default opt.FuncMap keys (#272) (@Daniel538)
  • e7e49c464796841b50737b73bac531a01d94bf66: feat: GetFieldParams and GetFieldParamsWithOptions functions (#261) (@saturn4er)
  • 92df8c483610990512b871e8ccf9d550d90c9dda: feat: adds public ToMap function (#275) (@maxfilov)
  • 13ac65527714f51e13b659bcaca1cd79b0993a98: feat: custom key value separator (#284) (@ruslan944)
  • 3f90e4aee403062b4bb2d1690bb677af45ef6b2f: enhancement: Expand with default values (#285) (@gabrielcipriano)

Documentation updates

  • 67236635cdfcab99baac3675ab5a058a49d853ee: docs: add map usage (#282) (@rfyiamcool)

Other work

  • 6061c47a86bc2ffec1ee6dcb6a3a6b0a1096d14c: release: v10 (@caarlos0)

Released with GoReleaser Pro!

v9.0.0

10 months ago

Changelog

New Features

  • 7a25c17e27bebe33ed7be5b169a95f61a0d90aae: feat!: accept expand as an option to the env tag (#263) (@caarlos0)
  • 4f6bb22b03e366362642bc1b1b2bb8ba5b5786ef: feat!: v9 (@caarlos0)
  • 9124b0abae524d4188d361dfef02bad9b97be423: feat: add support Web Assembly (#265) (@BorzdeG)

Bug fixes

  • 0f07b7f1a16b6ddbf3a03c82b26678ec48436bad: fix: invalid environment variable (#271) (@aymanbagabas)
  • 0b4d8a6c65bd475b19c0d49192a4efcae0d65896: fix: skip fields without env key in onSet (#266) (@aymanbagabas)

Documentation updates

  • 390412e4446ffcda767a61e790d3cb43efa03c9f: docs: clarify custom parser funcs and required fields (@caarlos0)
  • 3f7d8cf57c96b465f9186215134d7535ab78c6be: docs: fix examples in readme for v8.0.0 (#264) (@Mattias-)

Migrating from v8

Replace envExpand:"true" with ,expand, e.g.:

type Foo struct {
    Foo string `env:"FOO,expand"`
}

Released with GoReleaser Pro!

v8.0.0

1 year ago

Changelog

Other work

  • 224d85fd8e951dea1fe7cab6c51f390afd4b7efa: build: fix goreleaser flags (@caarlos0)
  • fac0414d0b77f17582fba4aaa5d435820c5a39f0: build: test on go stable and oldstable (#259) (@caarlos0)
  • 4e0f9156cfcf67667dd263ad13f0f9110cbe1798: feat!: refactor parse and parse with options (#256) (@caarlos0)

Updating from v7

  • if you use env.Parse with no options, no change is required.
  • if you use env.Parse with one Options{}, call env.ParseWithOptions instead.
  • if you use env.Parse with options, and pass more than one Options{}, merge them into a single one, and use env.ParseWithOptions instead.
  • if you use env.ParseWithFuncs, use env.ParseWithOptions instead, and put your parsers into Options{ FuncMap: <here> }.

Released with GoReleaser Pro!

v7.1.0

1 year ago

Changelog

New Features

  • b135bbd86c4110736a91edf6ac242ef0d4b43bd7: feat: error types (#240) (@akutuev)
  • 17f0a63edccb660238923ac0d02ab0432edb100d: feat: implement Is on AggregateError (#254) (@caarlos0)
  • 266f68b264d486a75ebf4b2371aab58a072b52fc: feat: support map kind env (#244) (@ken8203)
  • c08b0f906b39a1fbc978eeeb262840f9acd735ff: feat: use field name by default (#253) (@caarlos0)

Bug fixes

  • dfd68b2d5d324ecfe910012fe415a24c64d34e4b: fix: improve map handling, coverage (@caarlos0)
  • e5472ec015521ddbef81bfa12e752e86ee09fa4a: fix: remove untested behavior (@caarlos0)

Documentation updates

  • 65ba2db37013ed6bc2ebfadbbd2dc251ee528e0e: docs: caveats (@caarlos0)
  • f434e985558517cce98d345ea72faa1082e50640: docs: document how to handle error (@caarlos0)
  • 2d26ce1cd4c10a7fa055c643cfde3a4a295f8e6d: docs: fix examples (@caarlos0)
  • 91e69e8f885b30466508baca6220fec4e4307338: docs: maps (@caarlos0)
  • 850c2d8068a4e311cf2bd6f65a22dce5a66d5edd: docs: update to v7 (#249) (@alexandear)

Released with GoReleaser Pro!

v7.0.0

1 year ago

Changelog

Breaking changes

  • c687f95230cc26c3952b45eb4b82ae4fa07b4a85: feat!: set default if var is set but empty (#248) (@caarlos0)
  • 155f0a60a8f1bdfe72366001c6148857f681c4d6: feat!: update to v7 (@caarlos0)

Documentation updates

  • 23c6da15929313f5dabd12191adb6d1c1fc61ff1: docs: fix badge (@caarlos0)
  • 8e8e099592a5de2e329afaca3d46454d58b1d30f: docs: fix typo (#243) (@braindev)
  • 877e1bfe5d9a122d054bb5e9e402a0eced4871ff: docs: improve warning (@caarlos0)

Other work

  • ff86282879faca148d06ca25691e0e34d27b8b3e: build: fix lint workflow (@caarlos0)
  • 0b725c806f71de594b2535e6b8341c1a0824a4df: build: fix workflows (@caarlos0)
  • da848aabc7dc5c187f560fb38277caec36c2080d: build: remove deprecated lint option (@caarlos0)

Released with GoReleaser Pro!

v6.10.1

1 year ago

Changelog

Bug fixes

  • f3ddf1f7ee602a224429717ddc431e9083d45882: fix: non empty struct pointer value (#236) (@akutuev)

Released with GoReleaser Pro!

v6.10.0

1 year ago

Changelog

New Features

  • 69c7b5a1dc8b2c4e78a7211aef3fd102333e4e4f: feat: aggregate validation errors (#233) (@akutuev)

Bug fixes

  • 439dbad60f367bc1995f066cf9127743d468a572: fix: RequiredIfNoDef with nested structs (#229) (@HarmlessEvil)

Documentation updates

  • 60b5226da3e5e4ca3dcb795b8416f30c5cb2c5a9: docs: broken link (@caarlos0)
  • 4c93d81012635da80954a1b3ec2e30566aa1b9d9: docs: remove duplicate string (#232) (@dacapoday)

Released with GoReleaser Pro!

v6.9.3

1 year ago

Changelog

Bug fixes

  • a5d7cf5cd3ece44b603ffd8ce4a481b8432ed067: fix: custom parsers with anon inner structs (#227) (@caarlos0)

Released with GoReleaser Pro!

v6.9.2

1 year ago

Changelog

Bug fixes

  • 302a1031fb7c5e9de120b467f7ec1c636cd923e5: fix: race condition in ParseWithFuncs (#223) (@caarlos0)

Other work

  • 8eb2e726db15f6d74b8225095da3c70a0aadfcb1: refactor: remove unneccessary line (#212) (@gozeloglu)

Released with GoReleaser Pro!

v6.9.1

2 years ago

Changelog

Bug fixes

  • 66696b36d25095f5a0961050c5d0a965ec661e82: fix: passing prefix on anonymous struct (#205) (@flaneur2020)

Released with GoReleaser Pro!