mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 06:36:43 +08:00
update book code
This commit is contained in:
18
eBook/exercises/chapter_6/lambda_value.go
Executable file
18
eBook/exercises/chapter_6/lambda_value.go
Executable file
@@ -0,0 +1,18 @@
|
||||
// lambda_value.go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fv := func() {
|
||||
fmt.Println("Hello World!")
|
||||
}
|
||||
fv()
|
||||
fmt.Printf("The type of fv is %T", fv)
|
||||
}
|
||||
/* Output:
|
||||
Hello World!
|
||||
The type of fv is func()
|
||||
*/
|
Reference in New Issue
Block a user