Set environment variable in visual code


(Eliorpaz) #1

i need to setup environment variable in visual code IDE for the project.
i try in the launch.json like that:

“configurations”: [
{
“name”: “Launch”,
“type”: “go”,
“request”: “launch”,
“mode”: “auto”,
“program”: “${fileDirname}”,
“env”: {“GCP_PROJECT”:“example” },
“args”: []
}
]

but in os.Getenv(“GCP_PROJECT”) it return empty string.

please help!


(Boban Acimovic) #2

If you want to set environment variable in VSCode embedded terminal, try this:

http://serkanh.github.io/vscode,terminal,/2018/10/15/set-up-vscode-terminal-env-var.html