Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options to set defaults for zero values only #325

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

dnovikoff
Copy link
Contributor

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.

@dnovikoff dnovikoff force-pushed the set_default_for_zero_only branch 4 times, most recently from 6bb7931 to d7824e1 Compare August 24, 2024 16:43
Copy link

codecov bot commented Aug 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e55230b) to head (e8b732f).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #325   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          626       622    -4     
=========================================
- Hits           626       622    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dnovikoff dnovikoff force-pushed the set_default_for_zero_only branch 2 times, most recently from eacd4d3 to 4479add Compare October 14, 2024 09:15
@dnovikoff dnovikoff force-pushed the set_default_for_zero_only branch from 4479add to 1d07485 Compare October 22, 2024 13:01
Copy link
Owner

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, could you also add an example in example_test.go?

thanks!

@dnovikoff dnovikoff force-pushed the set_default_for_zero_only branch from 1d07485 to 58aa16b Compare February 20, 2025 20:13
@dnovikoff dnovikoff force-pushed the set_default_for_zero_only branch from 58aa16b to e8b732f Compare February 20, 2025 20:14
@dnovikoff
Copy link
Contributor Author

looks good, could you also add an example in example_test.go?

thanks!

I've added the example. Please check that it fits

@caarlos0
Copy link
Owner

looks good, thanks @dnovikoff

@caarlos0 caarlos0 merged commit 2be9960 into caarlos0:main Feb 21, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants