1、Func:函数可以接受多个不确定数量的参数
func TestOne(args ...string) {
for _, v:= range args{
fmt.Println(v)
}
}
2、Slice:将slice解构打散后进行传递
var strs = []string{
"123",
"456",
"789",
}
three_dot.TestOne(strs...)
three_dot.TestOne("123","456","789")
1、Func:函数可以接受多个不确定数量的参数
func TestOne(args ...string) {
for _, v:= range args{
fmt.Println(v)
}
}
2、Slice:将slice解构打散后进行传递
var strs = []string{
"123",
"456",
"789",
}
three_dot.TestOne(strs...)
three_dot.TestOne("123","456","789")