Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions opensca/sca/java/xml/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ func (p *printer) popPrefix() {
}

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.
Expand Down
8 changes: 4 additions & 4 deletions opensca/sca/java/xml/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ func (d *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error {
}

var (
attrType = reflect.TypeOf(Attr{})
unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
unmarshalerAttrType = reflect.TypeOf((*UnmarshalerAttr)(nil)).Elem()
textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
attrType = reflect.TypeFor[Attr]()
unmarshalerType = reflect.TypeFor[Unmarshaler]()
unmarshalerAttrType = reflect.TypeFor[UnmarshalerAttr]()
textUnmarshalerType = reflect.TypeFor[encoding.TextUnmarshaler]()
)

const (
Expand Down
2 changes: 1 addition & 1 deletion opensca/sca/java/xml/typeinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (

var tinfoMap sync.Map // map[reflect.Type]*typeInfo

var nameType = reflect.TypeOf(Name{})
var nameType = reflect.TypeFor[Name]()

// getTypeInfo returns the typeInfo structure with details necessary
// for marshaling and unmarshaling typ.
Expand Down