【go】Unmarshal时候报错提示proto.Unmarshal: missing method ProtoReflect
作者:互联网
问题:使用proto Unmarshal报错,提示以下信息:
cannot use promoRule (variable of type *db.PromotionRuleSet) as protoreflect.ProtoMessage value in argument to proto.Unmarshal: missing method ProtoReflect (compile)
解决方法:
import的包从
"google.golang.org/protobuf/proto"
改成
"github.com/golang/protobuf/proto"
标签:protobuf,proto,golang,报错,Unmarshal,method 来源: https://blog.csdn.net/zhuyunier/article/details/119170540