19

Golang&Goland配置

 4 years ago
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.
neoserver,ios ssh client

Golang配置

环境配置

  1. 设置环境变量 GOPROXY ,以使用 go get 的:
export GOPROXY=https://goproxy.io

Goland配置

gofmt与goimports(GoLand 2019.1.3)

File Watchers插件下载

Tools -> File Watchers中,添加如下设置:

yEfummM.png!web

image.png

Go Modules 配置(GoLand 2019.1.3)

  1. Preferences -> Go -> Go Modules (vgo),勾选 Enable Go Modules (vgo) integration 以启用 Go Modules,并在 Proxy 输入框中输入 https://goproxy.io 。如图所示:

    mQjuqeJ.png!web

    image.png

  2. Preferences -> Go -> GOPATH,勾选上 Index entire GOPATH 以索引整个 GOPATH,不然无法导入包。如图所示:

    RbAZ7zJ.png!web

    image.png

进行如上设置后,就可以在导入不在缓存中的包时,点击 Sync packages of... 下载该包了:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK