背景
いつの間にかprotocでprotoc-gen-goプラグインを使うと以下のようなエラーが出るようになりました。
2021/01/05 06:19:01 WARNING: Missing 'go_package' option in "xxx/xxx.proto", please specify it with the full Go package path as a future release of protoc-gen-go will require this be specified. See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.
現時点ではwarningですが、メッセージにあるように将来的にrequiredになるようなので早めに対応する方が良さそうです。
ドキュメントでも以下のようにgo_package
にフルパスのimportを指定するように書かれています。
The
.proto
file should contain a go_package option specifying the full import path of the Go package that contains the generated code.
ref: Go Generated Code | Protocol Buffers | Google Developers
続きを読む