Skip to content

Commit 98b9046

Browse files
committed
use legacy functions
1 parent 8eda55b commit 98b9046

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

encoder.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,13 @@ func (e *encoder) getMapKey(key reflect.Value, namespace []byte) (string, bool)
265265

266266
func (e *encoder) marshal(namespace []byte, v reflect.Value, idx int) (bool, error) {
267267
t := v.Type()
268-
if t.Kind() != reflect.Pointer && v.CanAddr() && reflect.PointerTo(t).Implements(marshalerType) {
268+
if t.Kind() != reflect.Ptr && v.CanAddr() && reflect.PtrTo(t).Implements(marshalerType) {
269269
return e.marshalAddr(namespace, v, idx)
270270
}
271-
if !t.Implements(marshalerType) && !reflect.PointerTo(t).Implements(marshalerType) {
271+
if !t.Implements(marshalerType) && !reflect.PtrTo(t).Implements(marshalerType) {
272272
return false, nil
273273
}
274-
if t.Kind() == reflect.Pointer && v.IsNil() {
274+
if t.Kind() == reflect.Ptr && v.IsNil() {
275275
return false, nil
276276
}
277277
um := v.Interface().(Marshaler)

0 commit comments

Comments
 (0)