// testStruct project main.go
package main
import (
"fmt"
)
type A struct {
Text string
}
type Operator interface {
Say()
}
func (a *A) Say() {
fmt.Printf("A::Say():%s\n", a.Text)
}
type B struct {
A
}
func (b *B) Say() {
b.A.Say()
fmt.Printf("B::Say():%s\n", b.Text)
}
func main() {
b := B{}
b.Text = "hello,world"
b.Say()
}
A::Say():hello,world
B::Say():hello,world