From c9d39dca8d9f4ad2bb644e095f5cea5486c1cd92 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Fri, 5 Nov 2010 11:22:28 -0700 Subject: [PATCH] gob: don't add "." if package path is empty when registering a type. R=rsc CC=golang-dev https://golang.org/cl/2939041 --- src/pkg/gob/type.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)