window搭建go环境

下载go的window安装包:
软件下载地址:https://studygolang.com/dl
手册地址:https://studygolang.com/pkgdoc

windows安装,下一步下一步就好,
然后就是配置GOPATH的环境(go的安装路径)和PATH的环境(go的安装路径下的bin路径)

代理服务配置:

$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.cn,direct

打开vscode,然后搜索go的扩展,然后安装。

Installing 15 tools at D:\go\bin in module mode.
  go-outline
  go-symbols
  guru
  gorename
  gotests
  gomodifytags
  impl
  fillstruct
  goplay
  godoctor
  dlv
  gocode-gomod
  godef
  goreturns
  golint

以上的安装扩展一般需要FQ的,或者自己手动github下载。以上使用七牛云的代理服务可以直接下载。

Installing github.com/ramya-rao-a/go-outline (D:\go\bin\go-outline.exe) SUCCEEDED
Installing github.com/acroca/go-symbols (D:\go\bin\go-symbols.exe) SUCCEEDED
Installing golang.org/x/tools/cmd/guru (D:\go\bin\guru.exe) SUCCEEDED
Installing golang.org/x/tools/cmd/gorename (D:\go\bin\gorename.exe) SUCCEEDED
Installing github.com/cweill/gotests/... (D:\go\bin\gotests.exe) SUCCEEDED
Installing github.com/fatih/gomodifytags (D:\go\bin\gomodifytags.exe) SUCCEEDED
Installing golang.org/x/tools/gopls (D:\go\bin\gopls.exe) SUCCEEDED

All tools successfully installed. You are ready to Go :).
Installing github.com/josharian/impl (D:\go\bin\impl.exe) SUCCEEDED
Installing github.com/davidrjenni/reftools/cmd/fillstruct (D:\go\bin\fillstruct.exe) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay (D:\go\bin\goplay.exe) SUCCEEDED
Installing github.com/godoctor/godoctor (D:\go\bin\godoctor.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv (D:\go\bin\dlv.exe) SUCCEEDED
Installing github.com/stamblerre/gocode (D:\go\bin\gocode-gomod.exe) SUCCEEDED
Installing github.com/rogpeppe/godef (D:\go\bin\godef.exe) SUCCEEDED
Installing github.com/sqs/goreturns (D:\go\bin\goreturns.exe) SUCCEEDED
Installing golang.org/x/lint/golint (D:\go\bin\golint.exe) SUCCEEDED

All tools successfully installed. You are ready to Go :).

以上就配置好了go的扩展,开发时可以自动添加go的扩展包啦

posted @ 2020-12-01 13:46  蝶墨轩冕  阅读(544)  评论(0编辑  收藏  举报