Goland 配置 Go 开发环境

  • 原创
  • Madman
  • /
  • /
  • 0
  • 7295 次阅读

Synopsis: Goland IDE 快速开发 Go 程序

jetbrains-agent-latest.zip

1. 安装与破解

前往 https://shareappscrack.com/jetbrains-goland/ 下载最新的破解版 Goland,下载完成后解压,解压密码一般是 www.ShareAppsCrack.com

然后运行 Goland 安装程序,比如 goland-2019.2.1_ShareAppsCrack.com.exe,安装过程中可以选择在桌面上创建快捷图标,我的安装目录为 D:\Program Files\JetBrains\GoLand 2019.2.1

安装完成后,拷贝 Crack 目录下的 jetbrains-agent.jar 到你指定的目录下,我放在 Goland 程序所在目录,即 D:\Program Files\JetBrains\GoLand 2019.2.1\bin\jetbrains-agent.jar

双击运行 Goland 图标,选择试用,再随便创建一个项目即可进入 Goland 主界面。依次点击 [Help] -> [Edit Custom VM Options...],在打开的文件末尾添加一行内容:

-javaagent:D:\Program Files\JetBrains\GoLand 2019.2.1\bin\jetbrains-agent.jar

重启 Goland

再依次点击 [Help] -> [Register...] -> [License server],输入 http://jetbrains-license-serverhttp://fls.jetbrains-agent.com,最后点击 [Activate] 即可激活。如果 License server 不可用时,也可以输入一下激活码:

JQE11SV0BR-eyJsaWNlbnNlSWQiOiJKUUUxMVNWMEJSIiwibGljZW5zZWVOYW1lIjoicGlnNiIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiIiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwiZmFsbGJhY2tEYXRlIjoiMjA4OS0wNy0wNyIsInBhaWRVcFRvIjoiMjA4OS0wNy0wNyJ9LHsiY29kZSI6IkFDIiwiZmFsbGJhY2tEYXRlIjoiMjA4OS0wNy0wNyIsInBhaWRVcFRvIjoiMjA4OS0wNy0wNyJ9LHsiY29kZSI6IkRQTiIsImZhbGxiYWNrRGF0ZSI6IjIwODktMDctMDciLCJwYWlkV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修改 C:\Windows\System32\drivers\etc\hosts,添加如下行:

# For GoLand
0.0.0.0 account.jetbrains.com
0.0.0.0 www.jetbrains.com

2. Go Modules 与 GORPOXY

启用 Go Modules,并设置 GOPROXY 为国内能够访问的代理服务器:

C:\Users\wangy>go env -w GO111MODULE=on
C:\Users\wangy>go env -w GOPROXY=https://goproxy.cn,direct

再手动设置 FileSettins...GoGo Modules (vgo)Proxyhttps://goproxy.cn,direct

3. 更换主题或字体

依次点击 [File] -> [Settings...] -> [Editor] -> [Color Scheme] -> [Color Scheme Font]

Goland  更改主题和字体.png

注意: 要想显示中文更美观,需要设置 Fallback fontMicrosoft Yahei Mono

或者你可以安装其它主题,依次点击 [File] -> [Settings] -> [Plugins],输入 Material Theme UI,安装即可

注意: 需要在 Plugins 页面右上角设置 HTTP Proxy Settings,不然下载插件时会非常慢

4. 自动导入包并格式化代码

go get -u -v golang.org/x/tools/cmd/goimports
go get -u -v golang.org/x/tools/cmd/godoc

依次点击 [File] -> [Settings...] -> [Tools] -> [File Watchers]

Goland 自动导入包并格式化代码.png

5. 调用 Debug

  1. Debugging with GoLand – Getting Started
  2. Debugging with GoLand – Essentials
  3. Debugging with GoLand – 高级调试功能
未经允许不得转载: LIFE & SHARE - 王颜公子 » Goland 配置 Go 开发环境

分享

作者

作者头像

Madman

如需 Linux / Python 相关问题付费解答,请按如下方式联系我

0 条评论

暂时还没有评论.

专题系列

文章目录