Function semantics
Variadic slice expansion
A compatible slice followed by ellipsis is supplied unchanged as the variadic parameter, so writes to its elements may affect the caller. Do not combine individual variadic arguments and a slice expansion for the same parameter. Example output: '[2 2]'.
Formal Syntax & Structure
go syntaxgo
f(values...)Working Example
Example Snippetgo
package main
import "fmt"
func bump(v ...int) { if len(v) > 0 { v[0]++ }}func main() { v := []int{1, 2} bump(v...) fmt.Println(v)}