目录

go goland idea 开发工具如何格式化 proto 代码

背景

在使用 grpc 开发时, proto 文件如何像 go 文件一样有 go fmt 统一进行格式化呢?

安装clang-format

goland 配置

设置—Tools—File Watchers—新增

/img/go-fmt-proto/0101.png
goland配置格式化proto工具

-style="{editor.defaultFormatter: zxh404.vscode-proto3}"
-i
$FilePath$

保存Goland配置并重启Goland,proto文件发生修改则可立即被格式化

ß