mirror of
https://github.com/golang/go
synced 2024-11-21 15:34:45 -07:00
gob: don't add "." if package path is empty when registering a type.
R=rsc CC=golang-dev https://golang.org/cl/2939041
This commit is contained in:
parent
40d10a34db
commit
c9d39dca8d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user