vscode-go
vscode-go copied to clipboard
I changed .bashrc file but the extension still use old bashrc config
What version of Go, VS Code & VS Code Go extension are you using?
- Run
go version
to get version of Go from the VS Code integrated terminal.- go version go1.16 linux/amd64
- Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.- 1.70.2 e4503b30fc78200f846c62cf8091b76ff5547662 x64
- Check your installed extensions to get the version of the VS Code Go extension
- v0.35.2
Describe the bug
- I set
export GOPATH=xxxx
in $HOME/.bashrc - but when I delete it in .bashrc, and try to run command 'go.tools.install' ,a exception appears
- the extension shows the error
4.I haven't export GOPATH but GOPATH still set
how can i do to delete GOPATH env
Use "unset GOPATH" in a shell to remove the variable from the environment. Could you try that, and re-run the go env command shown above, to see if it succeeds, and whether it still provides a value for GOPATH? Hopefully not, but if so, that would indicate that GOPATH is also in the go env configuration file, which can be updated with go env -w
.
But the fact that the terminal within vscode still has GOPATH even after your .bashrc has removed it suggests that you need to restart the vscode process so that it gets the new environment.
Use "unset GOPATH" in a shell to remove the variable from the environment. Could you try that, and re-run the go env command shown above, to see if it succeeds, and whether it still provides a value for GOPATH? Hopefully not, but if so, that would indicate that GOPATH is also in the go env configuration file, which can be updated with
go env -w
.But the fact that the terminal within vscode still has GOPATH even after your .bashrc has removed it suggests that you need to restart the vscode process so that it gets the new environment.
I have tried unset GOPATH and restart my vscode process but it doesn't work. Finally I restart my vitrualmachine and it worked ,the GOPATH isn't exist any more,so I think the GOPATH might still store in somewhere until I restart machine. It can be a bug?