diff options
Diffstat (limited to 'libgo/go/encoding/xml/typeinfo.go')
-rw-r--r-- | libgo/go/encoding/xml/typeinfo.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libgo/go/encoding/xml/typeinfo.go b/libgo/go/encoding/xml/typeinfo.go index 8f79c4e..36b35ed 100644 --- a/libgo/go/encoding/xml/typeinfo.go +++ b/libgo/go/encoding/xml/typeinfo.go @@ -46,6 +46,8 @@ const ( var tinfoMap = make(map[reflect.Type]*typeInfo) var tinfoLock sync.RWMutex +var nameType = reflect.TypeOf(Name{}) + // getTypeInfo returns the typeInfo structure with details necessary // for marshalling and unmarshalling typ. func getTypeInfo(typ reflect.Type) (*typeInfo, error) { @@ -56,7 +58,7 @@ func getTypeInfo(typ reflect.Type) (*typeInfo, error) { return tinfo, nil } tinfo = &typeInfo{} - if typ.Kind() == reflect.Struct { + if typ.Kind() == reflect.Struct && typ != nameType { n := typ.NumField() for i := 0; i < n; i++ { f := typ.Field(i) |