win10下配置VSCode+GO开发环境

  1. 安装Golang语言环境,链接:https://golang.google.cn/dl/

  2. 安装VSCode,链接:https://code.visualstudio.com/

  3. VSCode中搜索Go插件,如下图:
    win10下配置VSCode+GO开发环境_第1张图片

  4. 安装Go Tools相关依赖包(链接:https://github.com/Microsoft/vscode-go/wiki/Go-tools-that-the-Go-extension-depends-on)
    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 golang.org/x/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
    gometalinter --install

  5. 环境配置相关
    VSCode用户设置,为避免不同的项目重复下载依赖安装包,手动指定依赖包路径

    "go.toolsGopath":"系统环境GOPATH" 
    

    工作区设置,为每个项目设置单独的GOPATH

    "go.gopath": "D:\\Code\\Go",
    "files.autoSave": "afterDelay" 
    

你可能感兴趣的:(Go,Windows)