golang远程开发调试设置vscode插件失败解决方法记录

golang远程开发,插件安装失败

Failed to find the "go" binary in either GOROOT() or PATH(/root/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin). Check PATH, or Install Go and reload the window. If PATH isn't what you expected, see https://github.com/golang/vscode-go/issues/971

错误原因,go 的安装位置出错
需要将go的安装包放置在默认为:/usr/local/go
配置环境变量

# vim ~/.bashrc
...
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin

# source ~/.bashrc

可能需要重启一个新的客户端;

你可能感兴趣的:(golang,vscode,开发语言)