Refactor to use reflect.TypeFor
This commit is contained in:
parent
d29feaef79
commit
a2a6d20218
1 changed files with 1 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Got from https://github.com/xdg-go/strum/blob/main/types.go
|
// Got from https://github.com/xdg-go/strum/blob/main/types.go
|
||||||
var textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
|
var textUnmarshalerType = reflect.TypeFor[encoding.TextUnmarshaler]()
|
||||||
|
|
||||||
func isTextUnmarshaler(rv reflect.Value) bool {
|
func isTextUnmarshaler(rv reflect.Value) bool {
|
||||||
return rv.Type().Implements(textUnmarshalerType)
|
return rv.Type().Implements(textUnmarshalerType)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue