Functions
Functions
// If both are same type
func name(param1, param2 string) {}
// If different types
func name(param1 int, param2 string) {}Return types
func name(param1, param2 string) string {
return param1
}Return multiple values
func name(param1 int, param2 string) (int, string) {
return param1, param2
}
var a, b string = name("A", "B")Auto declare & return variables
Functions as parameters
Functions as values
Anonymous functions
Variadic functions
Closures
The main() function
main() functionLast updated