1、在docker容器中下载了go的sdk
2、在/etc/profile.d/go.sh里填入如下内容:
#!/bin/bash
export GOROOT=/home/ud_dev/go
export PATH=$GOROOT/bin:$PATH
3、设置go env
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GO111MODULE=on
4、重启这个容器,使得vscode能够识别$PATH
5、打开vscode配置
在
填写:
{
"go.gopath": "
标签:vscode,GOROOT,细节,export,env,go,PATH
From: https://blog.csdn.net/wtl1992/article/details/142014565