前往新版连接,https://www.cnblogs.com/nickchou/p/14096944.html

关于golang的开发IDE一般常用vscode和goland(推荐用Goland,在功能集成性上的速度和便捷度都非常好)

一、下载Goland

官网地址:https://www.jetbrains.com/go/
迅雷下载:https://download-cf.jetbrains.com/go/goland-2019.3.2.exe

二、下载注册补丁(pojie)(不需要改Host)

下载地址:https://pan.baidu.com/s/1FrpavOrzkzLDYShndnqRZQ 提取码 2c4t
下载并解压到指定文件夹(文件路径避免中文),注意必须要包含jetbrains-agent.jarimportant.txt2个文件,如图:
Window10  Goland-2019.3.2 安装+破解+常用配置
如果补丁下载有问题,请详见作者博客 https://zhile.io/

三、安装Goland

Window10  Goland-2019.3.2 安装+破解+常用配置
Window10  Goland-2019.3.2 安装+破解+常用配置
Window10  Goland-2019.3.2 安装+破解+常用配置
Window10  Goland-2019.3.2 安装+破解+常用配置
选择Skip Remaining and Set Default
Window10  Goland-2019.3.2 安装+破解+常用配置
选择试用,点Evaluate
Window10  Goland-2019.3.2 安装+破解+常用配置
点击Continue
Window10  Goland-2019.3.2 安装+破解+常用配置
创建一个空项目
Window10  Goland-2019.3.2 安装+破解+常用配置
点击创建
Window10  Goland-2019.3.2 安装+破解+常用配置
点击菜单栏:Help->Edit Custom VM Options...
Window10  Goland-2019.3.2 安装+破解+常用配置
提示是否创建goland64.exe.vmoptions,选择Create
Window10  Goland-2019.3.2 安装+破解+常用配置
在文件最后一行加上补丁配置,路径改成自己的

-javaagent:E:\Soft\Jetbrains\v.2019.3\jetbrains-agent.jar

Window10  Goland-2019.3.2 安装+破解+常用配置

然后重启下Goland
重启后再次点击 Help->Register,从ACTIVATION_CODE.txt在复制激活码到Avtivation code中,激活即可,如图适用于2019.3.3及以下的版本,不要升级2019.3.4
Window10  Goland-2019.3.2 安装+破解+常用配置

三、完成安装+破解

Window10  Goland-2019.3.2 安装+破解+常用配置
如果出现下面提示,回到步骤二看下,把下载的补丁包里未经修改的important.txt复制到jetbrains-agent.jar的同级目录即可
Window10  Goland-2019.3.2 安装+破解+常用配置

四、相关配置

1、实际在项目开发的时候发现一直提示"goland go list -m -json all" 且包也一直提示 Cannot resolve directory,如图:
Window10  Goland-2019.3.2 安装+破解+常用配置
请检查先项目里的Proxy配置(默认值是direct)改为 https://goproxy.cn,direct 即可
Window10  Goland-2019.3.2 安装+破解+常用配置
2、默认字体配置对中文支持不好,如图
Window10  Goland-2019.3.2 安装+破解+常用配置
菜单栏:File -> Setting(快捷键Ctrl+Alt+S),Simsun字体看起来好一些,也可以自行选择
Window10  Goland-2019.3.2 安装+破解+常用配置
效果图:
Window10  Goland-2019.3.2 安装+破解+常用配置
3、保存文件立即go fmt格式化代码
点击菜单栏:File->Settings->Tools->File Watchers->点击 "+"号,选择go fmt,直接保存即可。Ctrl+S后会自动格式化代码
Window10  Goland-2019.3.2 安装+破解+常用配置
4、Goland的Terminal设置为Git Bash
在File > Settings > Tools > Terminal > Shell_path 中的cmd.exe修改为 C:\Program Files\Git\bin\sh.exe,设置后在Terminal关闭tab再重新新增即可
Window10  Goland-2019.3.2 安装+破解+常用配置
5、取消下图调用方法返回的参数类型,仅针对2019.3的版本
Window10  Goland-2019.3.2 安装+破解+常用配置
菜单栏:File -> Setting(快捷键Ctrl+Alt+S)-> Editor -> Inlay Hits -> Go,取消Show parameter hits
Window10  Goland-2019.3.2 安装+破解+常用配置
6、编辑运行/调试配置
Window10  Goland-2019.3.2 安装+破解+常用配置
7、设置Ctrl+鼠标滚轮调整字体大小
Window10  Goland-2019.3.2 安装+破解+常用配置
8、设置鼠标悬浮显示文档
File -> Setting -> Editor -> General -> 找到Other下面的"Show Quick document on mouse move"
Window10  Goland-2019.3.2 安装+破解+常用配置
效果如下:
Window10  Goland-2019.3.2 安装+破解+常用配置

五、部分快捷键

说明 快捷键
转到定义 Ctrl+B
返回定义 Alt+方向左键
重命名文件or文件夹 Shift+F6
显示注释文档 Ctrl+Q

相关文章:

  • 2021-04-12
  • 2021-12-13
  • 2021-11-17
  • 2021-07-23
  • 2021-08-27
  • 2022-12-23
  • 2021-08-05
猜你喜欢
  • 2022-01-25
  • 2021-10-15
  • 2022-01-12
  • 2021-11-12
  • 2021-12-14
  • 2021-12-24
相关资源
相似解决方案