protoc-gen-go的不同版本兼容性问题
date
May 3, 2022
slug
protoc-gen-go的不同版本兼容性问题
status
Published
tags
protoc-gen-go
summary
protoc-gen-go的不同版本兼容性问题
type
Post
➜ proto protoc -I . helloworld.proto --go_out=plugins=grpc:.
protoc-gen-go: unable to determine Go import path for "helloworld.proto"
Please specify either:
• a "go_package" option in the .proto source file, or
• a "M" argument on the command line.
See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.
- -go_out: protoc-gen-go: Plugin failed with status code 1.
解决方法 采用老版本的proto-gen-go,使用命令切换为v1.3.2版本 go get -u github.com/golang/protobuf/protoc-gen-go@v1.3.2