ubuntu-VSCode中Go插件的配置问题解决

1. golang的SDK安装,参考资料:

golang-sdk安装icon-default.png?t=M4ADhttps://blog.csdn.net/RogerSCL/article/details/100852840?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165215173216782391836508%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=165215173216782391836508&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-3-100852840-null-null.142^v9^pc_search_result_control_group,157^v4^control&utm_term=ubuntu%E4%B8%8B%E5%AE%89%E8%A3%85VSCode%E9%85%8D%E7%BD%AEGo%E7%8E%AF%E5%A2%83&spm=1018.2226.3001.4187环境变量配置:

sudo vim /etc/profile

2. 设置go mod 代理(为了能够下载被墙资源)

# 配置 GOPROXY 环境变量
export GOPROXY=https://proxy.golang.com.cn,direct
# 还可以设置不走 proxy 的私有仓库或组,多个用逗号相隔(可选)
export GOPRIVATE=git.mycompany.com,github.com/my/private

3. 插件安装执行命令

3.1 克隆tools包到$GOPATH

git clone github.com/golang/tools.git

 3.2

插件命令,直接粘帖到终端

go install github.com/ramya-rao-a/go-outline@latest
go install github.com/acroca/go-symbols@latest
go install golang.org/x/tools/cmd/guru@latest
go install golang.org/x/tools/cmd/gorename@latest
go install github.com/josharian/impl@latest
go install github.com/rogpeppe/godef@latest
go install github.com/sqs/goreturns@latest
go install github.com/cweill/gotests/gotests@latest
go install github.com/ramya-rao-a/go-outline@latest
go install github.com/acroca/go-symbols@latest
go install golang.org/x/tools/cmd/guru@latest
go install golang.org/x/tools/cmd/gorename@latest
go install github.com/josharian/impl@latest
go install github.com/rogpeppe/godef@latest
go install github.com/sqs/goreturns@latest
go install github.com/golang/lint/golint@latest
go install github.com/cweill/gotests/gotests@latest

猜你喜欢

转载自blog.csdn.net/ALEX_CYL/article/details/124698207