I'm a bit confused with the next part of the code:
type Tiger struct {
weight int
}
func (t Tiger) Weight() int {
return t.weight
}
type AsianTiger struct {
Tiger
}
type Tigers interface {
Weight() int
}
func main() {
t := &AsianTiger{Tiger{3}}
var i Tigers = t
f := t.Weight
g := i.Weight
t.weight = 7
fmt.Println(f(), g()) // result is: 3 7 | expected 7 7
z := t
x := i
t.weight = 8 …Run Code Online (Sandbox Code Playgroud)