我正在尝试从 protobuf 文件编译成 golang。编译后,我在生成的 pb.go 中看到了这个
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.12.3
和
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
但是,之前生成的 pb.go 有
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
使用 proto 包的第 4 版,代码会中断。如何编译使其具有版本 3 的 ProtoPackage?