mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-11 22:00:03 +08:00
18 lines
231 B
Go
Executable File
18 lines
231 B
Go
Executable File
// 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()
|
|
*/ |