Skip to content

chore: simplify test with t.Setenv #129

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

Merged
merged 1 commit into from
Jan 27, 2025
Merged

Conversation

alexandear
Copy link
Contributor

@alexandear alexandear commented Jan 15, 2025

The PR refactors TestRunWithInputs by changing to use https://pkg.go.dev/testing#T.Setenv instead of os.Setenv:

Setenv calls os.Setenv(key, value) and uses Cleanup to restore the environment variable to its original value after the test.

This is detected with tenv linter.

@joerdav joerdav merged commit 56ebe49 into joerdav:main Jan 27, 2025
3 checks passed
@alexandear alexandear deleted the chore/t-setenv branch January 27, 2025 11:28
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