From 7907403a9782c03ccd7ad2571f2be484cea1e1cc Mon Sep 17 00:00:00 2001 From: xxxVitoxxx Date: Tue, 25 Jun 2024 22:40:46 +0800 Subject: [PATCH] Fix reflect.Pointer backward compatibility Explanation of what this pull request does. If we want to reflect.Pointer backward compatibility. here should use reflect.Ptr. --- marshaler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marshaler.go b/marshaler.go index fe67eccd..ef23e6e4 100644 --- a/marshaler.go +++ b/marshaler.go @@ -732,7 +732,7 @@ func walkStruct(ctx encoderCtx, t *table, v reflect.Value) { if fieldType.Anonymous { if fieldType.Type.Kind() == reflect.Struct { walkStruct(ctx, t, f) - } else if fieldType.Type.Kind() == reflect.Pointer && !f.IsNil() && f.Elem().Kind() == reflect.Struct { + } else if fieldType.Type.Kind() == reflect.Ptr && !f.IsNil() && f.Elem().Kind() == reflect.Struct { walkStruct(ctx, t, f.Elem()) } continue