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

feat: config to override env vars #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nickajacks1
Copy link

Add a config option to env provider to allow users to change the source of environment variables. Doing so is particularly useful in parallel tests where t.Setenv will not work.

Add a config option to env provider to allow users to change the source
of environment variables. Doing so is particularly useful in parallel
tests where t.Setenv will not work.
@knadh
Copy link
Owner

knadh commented Mar 6, 2025

This breaks the API and backwards compatibility. I suggest that we refactor this into a breaking github.com/knadh/koanf/providers/env/v2 version.

@nickajacks1
Copy link
Author

nickajacks1 commented Mar 6, 2025

Are you sure it's a breaking change? I tried to make it compatible by making it a variadic parameter. I'm OK with updating this to make a v2 if you prefer, though.

@knadh
Copy link
Owner

knadh commented Mar 7, 2025

Ah, my bad. Missed the variadic bit. Let me test this out next week. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants