It took me some time to wrap my mind around go’s inheritance. Here is how it works:
This results:
$8g inherit.go && 8l inherit.8
$ ./8.out
Hi
Fi
Just add the parent struct as anonymous property to allow the child to inherit parent’s methods.
This is part of my efford to create simple MUD server in go: gomud.