一、ProtocolBuffers配置
是否还在为proto文件中import的包无效的问题而烦恼?各种函数和声明无法跳转?解决它!
1. 检测Protocol Buffers插件是否安装
2. 配置Protocol Buffers,勾选 Additionally search for imported files in indexes
二、Proto文件格式化
go fmt本身无法支持proto文件的格式化,这时候需要用到clang-format
1. 下载LLVM
官网https://llvm.org/builds/下载相应的版本,此处我直接选下载Windows 64位版本
2. 安装LLVM,安装时注意勾选环境变量
3. 验证是否安装成功, clang-format -version
4.Goland配置clang-format, 注意执行程序需要选择已安装的 clang-format.exe
Arguments 按照如下规则填写:
-style="{BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0, AlignConsecutiveAssignments: true, AlignConsecutiveAssignments: true}"
-i
$FilePath$