Skip to content

chore: simplify test with t.Setenv#129

Merged
joerdav merged 1 commit into
joerdav:mainfrom
alexandear:chore/t-setenv
Jan 27, 2025
Merged

chore: simplify test with t.Setenv#129
joerdav merged 1 commit into
joerdav:mainfrom
alexandear:chore/t-setenv

Conversation

@alexandear

@alexandear alexandear commented Jan 15, 2025

Copy link
Copy Markdown
Contributor

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.

@alexandear alexandear requested a review from joerdav as a code owner January 15, 2025 16:31
@joerdav joerdav merged commit 56ebe49 into joerdav:main Jan 27, 2025
@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