Skip to content

v0.2.0

Choose a tag to compare

@ableinc ableinc released this 24 May 23:16
· 3 commits to main since this release

v0.2.0

New Features

  • Process function — map .env variables directly into a struct using struct tags (envconfig, split_words, required, default, ignored). Supports string, int, uint, float, and bool field types.
  • Optional filepath on LoadEnv and Process — both functions now accept an optional filepath argument. When omitted, .env is loaded by default, removing the need to pass nil or a pointer.

Breaking Changes

  • LoadEnv signature changed: LoadEnv(filepath *string, verbose bool) → LoadEnv(filepath ...string)
  • Process signature changed: Process(s any, filepath *string) → Process(s any, filepath ...string)
  • The verbose parameter has been removed from LoadEnv

Performance Improvements

  • Parallel env loading for files with 50+ variables — chunks are distributed across workers sized to available CPUs
  • Memory improvements to env file parsing (pre-allocated slices, zero-copy byte scanning)

Bug Fixes

  • Duplicate key handling: last occurrence now consistently wins
  • Fixed concurrency issues related to env file size thresholds

Other

  • Added Makefile with test and build targets
  • Added CI via GitHub Actions
  • go fix applied across codebase
  • Updated README with full API reference and struct tag documentation

Migration: Replace goenv.LoadEnv(&file, false) with goenv.LoadEnv(file), and goenv.Process(&cfg, nil) with goenv.Process(&cfg).