perhaps this is more accurate, unless the optional parameter was

intentionally left out
This commit is contained in:
Jason Thigpen
2012-04-26 14:49:23 -07:00
parent 6222160617
commit 84819eab71

View File

@@ -15,8 +15,8 @@ func aboutAllocation() {
slice := make([]int, 3) slice := make([]int, 3)
assert(len(slice) == __int__) // make() creates slices of a given length assert(len(slice) == __int__) // make() creates slices of a given length
slice = make([]int, 3) slice = make([]int, 3, __int__) // but can also take an optional capacity
assert(cap(slice) == 20) // but can also take an optional capacity assert(cap(slice) == 20)
m := make(map[int]string) m := make(map[int]string)
assert(len(m) == __int__) // make() also creates maps assert(len(m) == __int__) // make() also creates maps