So if I have the following struct in Go:
type Person struct {
name string
age int
}
Given that we don't know what consists of the Person
struct, how could we find out programmatically? I've had a look around and it seems that reflection could be used to do this perhaps?
Even just getting the keys for the struct data would be a start, as type []string
but ideally getting the types back also would be useful.