ch4: fix code path

This commit is contained in:
chai2010
2016-01-20 23:36:24 +08:00
parent ca0f87fad9
commit 3666d2f0e8
9 changed files with 16 additions and 30 deletions

View File

@@ -14,9 +14,8 @@ fmt.Printf("%q\n", runes) // "['H' 'e' 'l' 'l' 'o' ',' ' ' '世' '界']"
append函數對於理解slice底層是如何工作的非常重要所以讓我們仔細査看究竟是發生了什麽。下面是第一個版本的appendInt函數專門用於處理[]int類型的slice
<u><i>gopl.io/ch4/append</i></u>
```Go
gopl.io/ch4/append
func appendInt(x []int, y int) []int {
var z []int
zlen := len(x) + 1