panic: sql: expected 4 arguments, got 1
func add(args ...string) (total string) {
for _, v := range args {
total += v
}
return
}
func main() {
fmt.Println(add("1", "2", "3")) // 123
xs := []string{"1", "2", "3"}
fmt.Println(add(xs...)) // 123
}
...string
func Concat(strings ...string) bytes.Buffer {
buffer := bytes.Buffer{}
for _, str := range strings {
buffer.WriteString(str)
}
return buffer
}
Concat("Строка 1", "Строка 2", "Строка 3", "Строка 4", "Строка 5")