Golang&Goland配置
source link: https://studygolang.com/articles/26507
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Golang配置
环境配置
- 设置环境变量 GOPROXY ,以使用 go get 的:
export GOPROXY=https://goproxy.io
Goland配置
gofmt与goimports(GoLand 2019.1.3)
File Watchers插件下载
Tools -> File Watchers中,添加如下设置:
image.png
Go Modules 配置(GoLand 2019.1.3)
-
Preferences -> Go -> Go Modules (vgo),勾选 Enable Go Modules (vgo) integration 以启用 Go Modules,并在 Proxy 输入框中输入 https://goproxy.io 。如图所示:
image.png
-
Preferences -> Go -> GOPATH,勾选上 Index entire GOPATH 以索引整个 GOPATH,不然无法导入包。如图所示:
image.png
进行如上设置后,就可以在导入不在缓存中的包时,点击 Sync packages of... 下载该包了:
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK