-
Notifications
You must be signed in to change notification settings - Fork 646
How to set env var before run Go test command #475
Comments
I don't think there's any way to do this currently. Currently the extension just uses the environment that VS Code was launched with. PRs for a new configuration option to specify additional env vars to pass through to the |
Setting env variables via the configuration settings for the tests to use would apply the same env vars to all tests in the project. |
thanks @lukehoban @ramya-rao-a ,I want to use env variables for all tests in current workspace. |
@ysqi , Just to clarify ..
What you mean is in your case you would like to set an env var "runMode" and based on its value your tests would use different configs correct? And not that you would like a feature where vscode picks up different config files based on the runMode setting |
@ramya-rao-a the config file is that my application's file, not about vscode. |
@ysqi This feature is now available in the latest version of the Go extension : 0.6.44 |
I ran into this. Thank you so much!! 🙌 🙌 |
hi, Need use env var in go test , So I want to add Environment Variables just for go test command.
how to do it ? thanks!
Go: Run test at cursor
The text was updated successfully, but these errors were encountered: