Support encoding of pointers to embedded structs (#924)

This commit is contained in:
Daniel Graña
2024-01-23 15:06:33 -03:00
committed by GitHub
parent 34765b4a9e
commit 2ca21fb7b4
2 changed files with 34 additions and 0 deletions
+2
View File
@@ -707,6 +707,8 @@ 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 {
walkStruct(ctx, t, f.Elem())
}
continue
} else {