From 98b9046168710434aea166d15f0ec91b3065e4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tighearn=C3=A1n=20Carroll?= Date: Mon, 13 May 2024 16:56:00 +0100 Subject: [PATCH] use legacy functions --- encoder.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/encoder.go b/encoder.go index ddb3f66..ae3eb81 100644 --- a/encoder.go +++ b/encoder.go @@ -265,13 +265,13 @@ func (e *encoder) getMapKey(key reflect.Value, namespace []byte) (string, bool) func (e *encoder) marshal(namespace []byte, v reflect.Value, idx int) (bool, error) { t := v.Type() - if t.Kind() != reflect.Pointer && v.CanAddr() && reflect.PointerTo(t).Implements(marshalerType) { + if t.Kind() != reflect.Ptr && v.CanAddr() && reflect.PtrTo(t).Implements(marshalerType) { return e.marshalAddr(namespace, v, idx) } - if !t.Implements(marshalerType) && !reflect.PointerTo(t).Implements(marshalerType) { + if !t.Implements(marshalerType) && !reflect.PtrTo(t).Implements(marshalerType) { return false, nil } - if t.Kind() == reflect.Pointer && v.IsNil() { + if t.Kind() == reflect.Ptr && v.IsNil() { return false, nil } um := v.Interface().(Marshaler)