From fde64680927755492fff23b272f14c30412df686 Mon Sep 17 00:00:00 2001 From: chai2010 Date: Mon, 28 Dec 2015 21:55:06 +0800 Subject: [PATCH] zz --- book.json | 2 +- ch4/ch4-02.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/book.json b/book.json index cecc84c..6b2ead3 100644 --- a/book.json +++ b/book.json @@ -1,5 +1,5 @@ { - "title": "Go编程语言", + "title": "Go语言圣经", "description": "中文版", "language": "zh", "structure": { diff --git a/ch4/ch4-02.md b/ch4/ch4-02.md index 43c45e1..de14908 100644 --- a/ch4/ch4-02.md +++ b/ch4/ch4-02.md @@ -124,8 +124,6 @@ make([]T, len) make([]T, len, cap) // same as make([]T, cap)[:len] ``` -Under the hood, make creates an unnamed array variable and returns a slice of it; the array is accessible only through the returned slice. In the first form, the slice is a view of the entire array. In the second, the slice is a view of only the array’s first len elements, but its capacity includes the entire array. The additional elements are set aside for future growth. - 在底層,make創建了一個匿名的數組變量,然後返迴一個slice;隻有通過返迴的slice才能引用底層匿名的數組變量。在第一種語句中,slice是整個數組的view。在第二個語句中,slice隻引用了底層數組的前len個元素,但是容量將包含整個的數組。額外的元素是留給未來的增長用的。 {% include "./ch4-02-1.md" %}