Go by Example - Variadic Functions
Go by Example
Go is an open source programming language designed for building simple, fast, and reliable software.
Go by Example is a hands-on introduction to Go using annotated example programs. Check out the first example or browse the full list below.
Go by Example: Variadic Functions
可以使用任意数量的参数来调用可变参数函数,如fmt.Println
就是一个常用的可变参数函数。
1 | package main |
1 | $ go run variadic-functions.go |