Skip to content

testing: env: refactor SetEnvs #56

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

Open
kamilsk opened this issue Jul 8, 2021 · 1 comment
Open

testing: env: refactor SetEnvs #56

kamilsk opened this issue Jul 8, 2021 · 1 comment
Assignees

Comments

@kamilsk
Copy link
Member

kamilsk commented Jul 8, 2021

Setenv will be available at go 1.17: https://tip.golang.org/pkg/testing/#T.Setenv

pkg/testing/env.go

Lines 46 to 48 in d8517c0

func SetEnvs(handle func(error), vars ...env.Variable) (func(func(error)), error) {
return setEnvs(os.LookupEnv, os.Setenv, os.Unsetenv, handle, vars...)
}

@kamilsk kamilsk added the help wanted Extra attention is needed. label Jul 8, 2021
@kamilsk kamilsk self-assigned this Jul 8, 2021
@kamilsk kamilsk added difficulty: easy and removed help wanted Extra attention is needed. labels May 11, 2022
@kamilsk kamilsk moved this to Backlog in 🏗 Platform May 11, 2022
@kamilsk
Copy link
Member Author

kamilsk commented May 20, 2022

also, T.Cleanup is present, so I can extend for example testing.SetEnv to use it, see golang/mock@6d816de

@kamilsk kamilsk changed the title refactor SetEnvs env: refactor SetEnvs May 31, 2022
@kamilsk kamilsk changed the title env: refactor SetEnvs testing: env: refactor SetEnvs May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant