GO anonymous functions and closures
Anonymous function: As the name implies, it is a function without a name. There are many languages such as: java, js, php, etc., among which js is the most favorite. The biggest use of anonymous functions is to simulate block-level scope and avoid data pollution.Today I will mainly talk about anonymous functions and closures in the Golang language.Anonymous functionExample:1,package main import ( "fmt" ) func main() { f:=func(){ fmt.Println("hello world") } f()//hello world fmt.Printf("%T\n",
watch_later Read article