Type system
Go function types
Describes parameter and result types. Function values may be nil and can only be compared with nil, not each other. Example output: '12'.
Formal Syntax & Structure
go syntaxgo
func(T) RWorking Example
Example Snippetgo
package main
import ( "fmt")
func main() { var f func(int) int = func(n int) int { return n * 2 } fmt.Println(f(6))}