diff --git a/src/pkg/gob/type.go b/src/pkg/gob/type.go index a72a392cb04..d68c8773cfd 100644 --- a/src/pkg/gob/type.go +++ b/src/pkg/gob/type.go @@ -495,7 +495,11 @@ func Register(value interface{}) { } } if rt.Name() != "" { - name = star + rt.PkgPath() + "." + rt.Name() + if rt.PkgPath() == "" { + name = star + rt.Name() + } else { + name = star + rt.PkgPath() + "." + rt.Name() + } } RegisterName(name, value)