up:: [[Golang MOC]]
tags:: #on/computing/programming/languages/golang
# Variadic Functions in Go
Variadic functions are functions that accept a variable number of arguments. In Go, the sign of a variadic function is the last parameter being prefixed by an ellipsis.
The way it works is that the compiler converts the variable number of arguments into a slice.
> [!tip]
> Only the last parameter of a function can be variadic.
## Syntax
A variadic function can be written as follows:
```go
func example(a int, b ...int) {
}
```
## References
golangbot. “Variadic Functions,” June 19, 2021. [https://golangbot.com/variadic-functions/](https://golangbot.com/variadic-functions/).