VSCode配置go时,正确安装插件

   日期:2020-07-10     浏览:96    评论:0    
核心提示:由于被墙的原因,VSCode配置go开发环境时,总是提示插件安装失败,现给出自己写的命令文件,执行后,即可正确安装对应的插件。首先要配置好GOPATH。下载插件mkdir -vp $GOPATH/src/golang.org/xcd $GOPATH/src/golang.org/xgit clone https://github.com/golang/toolsgit clone https://github.com/golang/lintgit clone https://github.

由于被墙的原因,VSCode配置go开发环境时,总是提示插件安装失败,现给出自己写的命令文件,执行后,即可正确安装对应的插件。
首先要配置好GOPATH。

  1. 下载插件
mkdir -vp $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/tools
git clone https://github.com/golang/lint
git clone https://github.com/golang/mod
git clone https://github.com/golang/xerrors

mkdir -vp $GOPATH/src/github.com
cd $GOPATH/src/github.com

mkdir -vp mdempsky/gocode
git clone https://github.com/mdempsky/gocode ./mdempsky/gocode

mkdir -vp karrick/godirwalk
git clone https://github.com/karrick/godirwalk ./karrick/godirwalk

mkdir -vp pkg/errors
git clone https://github.com/pkg/errors ./pkg/errors

mkdir -vp uudashr/gopkgs
git clone https://github.com/uudashr/gopkgs ./uudashr/gopkgs

mkdir -vp ramya-rao-a/go-outline
git clone https://github.com/ramya-rao-a/go-outline ./ramya-rao-a/go-outline

mkdir -vp acroca/go-symbols
git clone https://github.com/acroca/go-symbols ./acroca/go-symbols

mkdir -vp go-delve/delve
git clone https://github.com/go-delve/delve ./go-delve/delve

mkdir -vp stamblerre/gocode
git clone https://github.com/stamblerre/gocode ./stamblerre/gocode

mkdir -vp rogpeppe/godef
git clone https://github.com/rogpeppe/godef ./rogpeppe/godef

mkdir -vp sqs/goreturns
git clone https://github.com/sqs/goreturns ./sqs/goreturns

mkdir -vp cweill/gotests
git clone https://github.com/cweill/gotests ./cweill/gotests

mkdir -vp fatih/gomodifytags
git clone https://github.com/fatih/gomodifytags ./fatih/gomodifytags

mkdir -vp josharian/impl
git clone https://github.com/josharian/impl ./josharian/impl

mkdir -vp davidrjenni/reftools
git clone https://github.com/davidrjenni/reftools ./davidrjenni/reftools

mkdir -vp skratchdot/open-golang
git clone  https://github.com/skratchdot/open-golang ./skratchdot/open-golang

mkdir -vp haya14busa/goplay
git clone  https://github.com/haya14busa/goplay ./haya14busa/goplay

mkdir -vp godoctor/godoctor
git clone https://github.com/godoctor/godoctor ./godoctor/godoctor

  1. 安装插件
cd $GOPATH/src
echo "1.install gocode"
go install github.com/mdempsky/gocode
echo "2.install gopkgs"
go install github.com/uudashr/gopkgs/v2/cmd/gopkgs
echo "3.install go-outline"
go install github.com/ramya-rao-a/go-outline
echo "4.install go-symbols"
go install github.com/acroca/go-symbols
echo "5.install guru"
go install golang.org/x/tools/cmd/guru
echo "6.install gorename"
go install golang.org/x/tools/cmd/gorename
echo "7.install gotests"
go install github.com/cweill/gotests/gotests
echo "8.install gomodifytags"
go install github.com/fatih/gomodifytags
echo "9.install impl"
go install github.com/josharian/impl
echo "10.install fillstruct"
go install github.com/davidrjenni/reftools/cmd/fillstruct
echo "11.install goplay"
go install github.com/haya14busa/goplay/cmd/goplay
echo "12.install godoctor"
go install github.com/godoctor/godoctor
echo "13.install dlv"
go install github.com/go-delve/delve/cmd/dlv
echo "14.install gocode-gomod"
go install github.com/stamblerre/gocode
echo "15.install godef"
go install github.com/rogpeppe/godef
echo "16.install goreturns"
go install github.com/sqs/goreturns
echo "17.install golint"
go install golang.org/x/lint/golint
echo "18.install goimports"
go install golang.org/x/tools/cmd/goimports
echo "finish"
 
打赏
 本文转载自:网络 
所有权利归属于原作者,如文章来源标示错误或侵犯了您的权利请联系微信13520258486
更多>最近资讯中心
更多>最新资讯中心
0相关评论

推荐图文
推荐资讯中心
点击排行
最新信息
新手指南
采购商服务
供应商服务
交易安全
关注我们
手机网站:
新浪微博:
微信关注:

13520258486

周一至周五 9:00-18:00
(其他时间联系在线客服)

24小时在线客服