【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"
上一篇:MIT OS LAB3 pA


下一篇:Java语言概述