I am still fairly new to Go.
Is it possible to return a child type from an embedded parent function?
Something along the lines of the following code:
type Humans struct {
NextPage string
}
type Employees struct {
Humans
Items []struct {
Stuff string
DifferentStuff float64
}
}
func (h *Human) Next() interface{} {
list interface{}
jsonGet(h.NextPage, &list)
return list
}
func main() {
list := Employees{}
jsonGet("http://blah.blah", &list)
for ; list != nil; list = list.Next() {
for _, item := range list.Items {
... do stuff ...
}
}
}
No.
Embedding is not inheritance.