From fc1f71756ce9d38644d1687812bf8541f56cb409 Mon Sep 17 00:00:00 2001 From: hbc Date: Sat, 12 Aug 2023 14:04:21 +0800 Subject: [PATCH] doc: call out why we need pkgPath prefix --- mockgen/model/model.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mockgen/model/model.go b/mockgen/model/model.go index 55324f9..e2dde53 100644 --- a/mockgen/model/model.go +++ b/mockgen/model/model.go @@ -147,6 +147,8 @@ type Type interface { } func init() { + // Call gob.RegisterName with pkgPath as prefix to avoid conflicting with + // github.com/golang/mock/mockgen/model 's registration. gob.RegisterName(pkgPath+".ArrayType", &ArrayType{}) gob.RegisterName(pkgPath+".ChanType", &ChanType{}) gob.RegisterName(pkgPath+".FuncType", &FuncType{})