Skip to content

Commit

Permalink
Fix reflect.Pointer backward compatibility
Browse files Browse the repository at this point in the history
Explanation of what this pull request does.
If we want to reflect.Pointer backward compatibility. here should use reflect.Ptr.
  • Loading branch information
xxxVitoxxx committed Jul 30, 2024
1 parent bccd6e4 commit 7907403
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion marshaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7907403

Please sign in to comment.