1
0
mirror of https://github.com/golang/go synced 2024-11-20 10:04:45 -07:00

encoding/gob: fix bug in Register

The old code added a star but did not indirect the reflect.Type.

R=bradfitz
CC=golang-dev
https://golang.org/cl/6348067
This commit is contained in:
Rob Pike 2012-07-03 10:05:27 -07:00
parent d9c4cef670
commit b04bf3882b

View File

@ -755,7 +755,7 @@ func Register(value interface{}) {
if rt.Name() == "" {
if pt := rt; pt.Kind() == reflect.Ptr {
star = "*"
rt = pt
rt = pt.Elem()
}
}
if rt.Name() != "" {