mirror of https://github.com/Xhofe/alist
Refactor to use reflect.TypeFor
parent
c64f899a63
commit
bb089c1017
|
@ -546,9 +546,9 @@ func (p *printer) setAttrPrefix(prefix, url string) {
|
|||
}
|
||||
|
||||
var (
|
||||
marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem()
|
||||
marshalerAttrType = reflect.TypeOf((*MarshalerAttr)(nil)).Elem()
|
||||
textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()
|
||||
marshalerType = reflect.TypeFor[Marshaler]()
|
||||
marshalerAttrType = reflect.TypeFor[MarshalerAttr]()
|
||||
textMarshalerType = reflect.TypeFor[encoding.TextMarshaler]()
|
||||
)
|
||||
|
||||
// marshalValue writes one or more XML elements representing val.
|
||||
|
|
|
@ -44,7 +44,7 @@ const (
|
|||
var tinfoMap = make(map[reflect.Type]*typeInfo)
|
||||
var tinfoLock sync.RWMutex
|
||||
|
||||
var nameType = reflect.TypeOf(Name{})
|
||||
var nameType = reflect.TypeFor[Name]()
|
||||
|
||||
// getTypeInfo returns the typeInfo structure with details necessary
|
||||
// for marshalling and unmarshalling typ.
|
||||
|
|
Loading…
Reference in New Issue