Given the following types:
type (
Parent struct {
name string
surname string
}
Child struct {
*Parent
sport String
}
)
...
func (p *Parent) GetSport() string {
return ((*Child)(p)).sport // does not work
}
How do I convert *Parent
to *Child
?