October 2015
Beginner to intermediate
400 pages
14h 44m
English
A function declaration has a name, a list of parameters, an optional list of results, and a body:
func name(parameter-list) (result-list) {
body
}
The parameter list specifies the names and types of the function’s parameters,
which are the local variables whose values or arguments are supplied by the caller.
The result list specifies the types of the values that the function returns.
If the function returns one unnamed result or no results at all,
parentheses are optional and usually omitted.
Leaving off the result list entirely declares a function that
does not return any value and is called only for its effects.
In the hypot function,
func hypot(x, ...