VSCode安装Go插件教程

VSCode安装Go插件教程

Golang 、Git 与 VSCode的下载安装与环境配置请自行百度, 此处着重强调如何离线安装VSCode中的Go插件, 如果按我说的方法无法解决, 可以联系我(VX: Kevin_ze ). 当然, 前提是我也能解决的情况下. 哈哈。

☆☆☆☆☆ 懒人请直接拖至最后☆☆☆☆☆

[0]前提: 检查环境变量

默认你已经安装好golang,以及VSCode

  • 查看GOPATH与GOROOT参数 (cmd下输入)
go env
  • 部分结果如图:

在这里插入图片描述

[1]开始: 新建目录

    1. 在%GOPATH%中目录结构 (手动建立bin、pkg、src目录)
    %GOPATH%
    ├─bin
    ├─pkg
    └─src
        ├─github.com
        │  ├─acroca
        │  ├─cweill
        │  ├─fatih                              
        │  ├─go-delve
        │  ├─golang
        │  ├─haya14busa
        │  ├─josharian      
        │  ├─karrick
        │  ├─mdempsky
        │  ├─nsf
        │  ├─pkg
        │  ├─ramya-rao-a
        │  ├─rogpeppe
        │  ├─skratchdot
        │  ├─sqs  
        │  ├─stamblerre
        │  └─uudashr
        └─golang.org
            └─x
                ├─lint
                ├─net
                └─tools
    

    [2]下载: github.com

    cd %GOPATH%/src
    
    git clone https://github.com/golang/tools.git golang.org/x/tools
    git clone https://github.com/nsf/gocode github.com/nsf/gocode
    git clone https://github.com/uudashr/gopkgs.git github.com/uudashr/gopkgs
    git clone https://github.com/karrick/godirwalk.git github.com/karrick/godirwalk
    git clone https://github.com/pkg/errors.git github.com/pkg/errors
    git clone https://github.com/ramya-rao-a/go-outline.git github.com/ramya-rao-a/go-outline
    git clone https://github.com/acroca/go-symbols.git github.com/acroca/go-symbols
    git clone https://github.com/fatih/gomodifytags.git github.com/fatih/gomodifytags
    git clone https://github.com/haya14busa/goplay.git github.com/haya14busa/goplay
    git clone https://github.com/skratchdot/open-golang.git github.com/skratchdot/open-golang
    git clone https://github.com/josharian/impl.git github.com/josharian/impl
    git clone https://github.com/rogpeppe/godef.git github.com/rogpeppe/godef
    git clone https://github.com/sqs/goreturns.git github.com/sqs/goreturns
    git clone https://github.com/golang/lint.git golang.org/x/lint
    git clone https://github.com/cweill/gotests.git github.com/cweill/gotests
    git clone https://github.com/go-delve/delve.git github.com/go-delve/delve
    git clone https://github.com/golang/net.git golang.org/x/net
    git clone https://github.com/golang/text.git golang.org/x/text
    

    [3]安装: (直接下载rar,解压后,需要继续执行)

    cd %GOPATH%
    
    go install github.com/nsf/gocode
    go install github.com/uudashr/gopkgs/cmd/gopkgs
    go install github.com/ramya-rao-a/go-outline
    go install github.com/acroca/go-symbols
    go install golang.org/x/tools/cmd/guru
    go install golang.org/x/tools/cmd/gorename
    go install github.com/fatih/gomodifytags
    go install github.com/haya14busa/goplay/cmd/goplay
    go install github.com/josharian/impl
    go install github.com/rogpeppe/godef
    go install github.com/sqs/goreturns
    go install golang.org/x/lint/golint
    go install github.com/cweill/gotests/...
    go install github.com/go-delve/delve/cmd/dlv
    

    [4]最后: 重启VSCode

    至此如果还是不会安装的话, 请直接点击下面的链接。

CSDN下载

收取积分有违本意,请绕路百度网盘。

链接: https://pan.baidu.com/s/1s7RpeQYqYr5El0OtvOcUkg 提取码: ywp6 复制这段内容后打开百度网盘手机App,操作更方便哦

(直接下载rar , 解压后,需要继续执行步骤[3]安装)

你可能感兴趣的:(VSCode安装Go插件教程)