mirror of
https://github.com/golang/go
synced 2024-11-22 03:14:41 -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.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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user