From 67f7183b85ccec77da44a823f419cfcd74d8c1e3 Mon Sep 17 00:00:00 2001 From: Alex Flint Date: Sat, 29 Oct 2022 15:10:11 -0400 Subject: [PATCH] remove unused textMarshalerType and isTextMarshaler --- reflect.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/reflect.go b/reflect.go index 64c6343..466d65f 100644 --- a/reflect.go +++ b/reflect.go @@ -10,10 +10,7 @@ import ( scalar "github.com/alexflint/go-scalar" ) -var ( - textMarshalerType = reflect.TypeOf([]encoding.TextMarshaler{}).Elem() - textUnmarshalerType = reflect.TypeOf([]encoding.TextUnmarshaler{}).Elem() -) +var textUnmarshalerType = reflect.TypeOf([]encoding.TextUnmarshaler{}).Elem() // cardinality tracks how many tokens are expected for a given spec // - 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 func isTextUnmarshaler(t reflect.Type) bool { return t.Implements(textUnmarshalerType) || reflect.PtrTo(t).Implements(textUnmarshalerType)