Function semantics

Function calls

A call evaluates the function and arguments and binds argument values to parameters. The number and assignability of arguments must match the signature except for variadic and multi-result forwarding rules. Calling a nil function value panics. Example output: '12'.

Formal Syntax & Structure

go syntaxgo
f(arg1, arg2)

Working Example

Example Snippetgo
package main
import "fmt"
func area(w, h int) int { return w * h }func main() {  fmt.Println(area(3, 4))}
Go Reference