mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-11 22:53:43 +08:00
19 lines
195 B
Go
19 lines
195 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)
|
|
}
|