mirror of
https://github.com/golang/go
synced 2024-11-24 22:00:09 -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,8 +495,12 @@ func Register(value interface{}) {
|
||||
}
|
||||
}
|
||||
if 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