mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
Updated SliceTricks (markdown)
parent
2ed870fe5e
commit
1265d4d8ab
@ -11,6 +11,12 @@ a = append(a, b...)
|
||||
```go
|
||||
b = make([]T, len(a))
|
||||
copy(b, a)
|
||||
|
||||
// These two are often a little slower than the above one,
|
||||
// but they would be more efficient if there are more
|
||||
// elements to be appended to b.
|
||||
b = append([]T(nil), a...)
|
||||
b = append(a[:0:0], a...
|
||||
```
|
||||
|
||||
#### Cut
|
||||
|
Loading…
x
Reference in New Issue
Block a user