Commit c9d39dca authored by Rob Pike's avatar Rob Pike

gob: don't add "." if package path is empty when registering a type.

R=rsc
CC=golang-dev
https://golang.org/cl/2939041
parent 40d10a34
...@@ -495,8 +495,12 @@ func Register(value interface{}) { ...@@ -495,8 +495,12 @@ func Register(value interface{}) {
} }
} }
if rt.Name() != "" { if rt.Name() != "" {
if rt.PkgPath() == "" {
name = star + rt.Name()
} else {
name = star + rt.PkgPath() + "." + rt.Name() name = star + rt.PkgPath() + "." + rt.Name()
} }
}
RegisterName(name, value) RegisterName(name, value)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment