美文网首页
vs code 配置 golang 开发环境

vs code 配置 golang 开发环境

作者: 42cc8919e42f | 来源:发表于2018-09-21 15:57 被阅读0次

    安装官方 go 开发插件

    image.png

    安装相关组件

    • 新建任意一 .go 文件,保存
    • 安装依赖的组件
    go get -u -v github.com/ramya-rao-a/go-outline
    go get -u -v github.com/acroca/go-symbols
    go get -u -v github.com/mdempsky/gocode
    go get -u -v github.com/rogpeppe/godef
    go get -u -v golang.org/x/tools/cmd/godoc
    go get -u -v github.com/zmb3/gogetdoc
    go get -u -v github.com/golang/lint/golint
    go get -u -v github.com/fatih/gomodifytags
    go get -u -v golang.org/x/tools/cmd/gorename
    go get -u -v sourcegraph.com/sqs/goreturns
    go get -u -v golang.org/x/tools/cmd/goimports
    go get -u -v github.com/cweill/gotests/...
    go get -u -v golang.org/x/tools/cmd/guru
    go get -u -v github.com/josharian/impl
    go get -u -v github.com/haya14busa/goplay/cmd/goplay
    go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs
    go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct
    go get -u -v github.com/alecthomas/gometalinter
    
    • 国内相关组件会安装超时
      git clone https://github.com/golang/tools.git tools
      将 tools 目录移动至 $GOPATH/x 目录下
    • 然后手动安装相关组件
      go install ...
      go install golang.org/x/tools/cmd/guru

    安装完成

    相关文章

      网友评论

          本文标题:vs code 配置 golang 开发环境

          本文链接:https://www.haomeiwen.com/subject/futznftx.html