caarlos0 / env

A simple, zero-dependencies library to parse environment variables into structs
https://pkg.go.dev/github.com/caarlos0/env/v11
MIT License
4.91k stars 252 forks source link

Options to set defaults for zero values only #325

Open dnovikoff opened 2 months ago

dnovikoff commented 2 months ago

I've encountered scenarious of loading config from file and then applying env vars. Would be nice to ignore defaults for thouse values already set.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (e55230b) to head (1d07485).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #325 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 3 3 Lines 626 628 +2 ========================================= + Hits 626 628 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.