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,15 +1,16 @@
|
||||
package main
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
f()
|
||||
}
|
||||
|
||||
func f() {
|
||||
for i := 0; i < 4; i++ {
|
||||
g := func(i int) { fmt.Printf("%d ", i) }
|
||||
g(i)
|
||||
fmt.Printf(" - g is of type %T and has value %v\n", g, g)
|
||||
}
|
||||
|
||||
}
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
f()
|
||||
}
|
||||
|
||||
func f() {
|
||||
for i := 0; i < 4; i++ {
|
||||
g := func(i int) { fmt.Printf("%d ", i) }
|
||||
g(i)
|
||||
fmt.Printf(" - g is of type %T and has value %v\n", g, g)
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user