Functional literals
A functional literal just represents an anonymous function. You can assign functional literal to a variable:
package main import ( "fmt" ) func main() { f := func() { fmt.Println("Hello, भारत!") } f() } Or invoke functional literal directly (Please notice the () at the end of functional literal):
package main import ( "fmt" ) func main() { func() { fmt.Println("Hello, भारत!") }() } The above 2 programs both output “Hello, भारत!”.
[Read More]