I have a nested three layer struct. I would like to use reflect in Go to parse it (use recursive function). The reasons to use reflect and the recursive function are
- can have various number of fields (but the first two fields are fixed)
- the field types are not fixed.
- The number of nested layers can be different (in this example only three layers. It can be many more)
When I ran this, in the first layer I got "type: *entity.SacWebIS". However, in the second iteration/recursion, I got "type: *reflect.rtype" .
How to modify this code? Thanks.
Aucun commentaire:
Enregistrer un commentaire