remove unused textMarshalerType and isTextMarshaler

This commit is contained in:
Alex Flint 2022-10-29 15:10:11 -04:00
parent 522dbbcea8
commit 67f7183b85
1 changed files with 1 additions and 9 deletions

View File

@ -10,10 +10,7 @@ import (
scalar "github.com/alexflint/go-scalar" scalar "github.com/alexflint/go-scalar"
) )
var ( var textUnmarshalerType = reflect.TypeOf([]encoding.TextUnmarshaler{}).Elem()
textMarshalerType = reflect.TypeOf([]encoding.TextMarshaler{}).Elem()
textUnmarshalerType = reflect.TypeOf([]encoding.TextUnmarshaler{}).Elem()
)
// cardinality tracks how many tokens are expected for a given spec // cardinality tracks how many tokens are expected for a given spec
// - zero is a boolean, which does to expect any value // - zero is a boolean, which does to expect any value
@ -91,11 +88,6 @@ func isBoolean(t reflect.Type) bool {
} }
} }
// isTextMarshaler returns true if the type or its pointer implements encoding.TextMarshaler
func isTextMarshaler(t reflect.Type) bool {
return t.Implements(textMarshalerType) || reflect.PtrTo(t).Implements(textMarshalerType)
}
// isTextUnmarshaler returns true if the type or its pointer implements encoding.TextUnmarshaler // isTextUnmarshaler returns true if the type or its pointer implements encoding.TextUnmarshaler
func isTextUnmarshaler(t reflect.Type) bool { func isTextUnmarshaler(t reflect.Type) bool {
return t.Implements(textUnmarshalerType) || reflect.PtrTo(t).Implements(textUnmarshalerType) return t.Implements(textUnmarshalerType) || reflect.PtrTo(t).Implements(textUnmarshalerType)