1. 操作
1. 1 自动格式化和导入包
go fmt + go imports
go to preferences ->Tools ->File Watchers and enable go fmt . This way on each save it will format the file.
goland tools->filewatchers->go fmt| go imports
1.2 快捷键
删除行 cmd + x
复制行 cmd + d
进入返回函数 cmd + []
1.3 文件
快速搜索文件名字: 两次 shift
比较文件: 选择两个文件
cmd+d
, 方便比较json文件导航 cmd + 7 折叠, 展开,设置,隐藏
按导出排序(建议), 按字母排序(建议), 私有函数(建议), 非当前文件的属性(不建议)
呼出最近文件和常用功能
cmd + E
, favorites 可以查看书签/断点/收藏
1.4 代码
- 查看struct实现了哪些接口
cmd + u
- interface查看实现的Struct的列表
ctrl + h
2. 错误
2.1 Cannot resolve symbol
鼠标在报错地方, 弹出提示,sync即可解决。
2.2 导入包错误
1 | 1. export GOINSECURE="gitlab.staff.funlink-tech.com",GOPRIVATE="gitlab.staff.funlink-tech.com" |