mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-08-09 08:31:58 +00:00
第4章,部分字词修订。
This commit is contained in:
@@ -105,7 +105,7 @@ x = append(x, x...) // append the slice x
|
||||
fmt.Println(x) // "[1 2 3 4 5 6 1 2 3 4 5 6]"
|
||||
```
|
||||
|
||||
通过下面的小修改,我们可以可以达到append函数类似的功能。其中在appendInt函数参数中的最后的“...”省略号表示接收变长的参数为slice。我们将在5.7节详细解释这个特性。
|
||||
通过下面的小修改,我们可以达到append函数类似的功能。其中在appendInt函数参数中的最后的“...”省略号表示接收变长的参数为slice。我们将在5.7节详细解释这个特性。
|
||||
|
||||
```Go
|
||||
func appendInt(x []int, y ...int) []int {
|
||||
|
Reference in New Issue
Block a user