diff options
| author | Ian Lance Taylor <iant@golang.org> | 2023-07-31 15:20:54 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-08-01 14:29:37 +0000 |
| commit | db25bc19e5221c7df2caed3b1daeda673ec757d9 (patch) | |
| tree | 9a0ede31eedafda3415d296800b04151450f95fd /src/encoding/xml/marshal.go | |
| parent | 29253f4d513f1d3fe549db39a8daa311492138b3 (diff) | |
| download | go-db25bc19e5221c7df2caed3b1daeda673ec757d9.tar.xz | |
encoding/xml: use reflect.TypeFor for known types
For #60088
Change-Id: Ib2589b994d304cca1f2e2081639959d80818ac7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/514639
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Diffstat (limited to 'src/encoding/xml/marshal.go')
| -rw-r--r-- | src/encoding/xml/marshal.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/encoding/xml/marshal.go b/src/encoding/xml/marshal.go index 0c3cc0dc36..e641148011 100644 --- a/src/encoding/xml/marshal.go +++ b/src/encoding/xml/marshal.go @@ -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. |
