mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:21:38 +08:00
fix: coding style and file format for all example.
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user