Chuanshuoge
Sunday, 27 September 2020
golang 7 function 2
package main
import "fmt"
func main() {
result := func(x int) int {
return x * -1
}
(8)
fmt.Println(result)
}
//cmd
C:\Users\bob\golang1>go run tutorial.go
-8
reference:
https://www.youtube.com/watch?v=vdm04bVzkLg&list=PLzMcBGfZo4-mtY_SE3HuzQJzuj4VlUG0q&index=17
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment