Files
the-way-to-go_ZH_CN/eBook/examples/chapter_10/embedd_struct.go
2015-03-03 12:25:25 -05:00

19 lines
213 B
Go

package main
import "fmt"
type A struct {
ax, ay int
}
type B struct {
A
bx, by float32
}
func main() {
b := B{A{1, 2}, 3.0, 4.0}
fmt.Println(b.ax, b.ay, b.bx, b.by)
fmt.Println(b.A)
}