compiler: implement make([]T, ...)

This commit is contained in:
Ayke van Laethem
2018-09-06 09:46:58 +02:00
parent ef2c406127
commit 094c5561b6
3 changed files with 54 additions and 1 deletions
+3
View File
@@ -35,8 +35,11 @@ func main() {
readMap(testmap, "data")
// slice
l := 5
foo := []int{1, 2, 4, 5}
bar := make([]byte, l-2, l)
println("len/cap foo:", len(foo), cap(foo))
println("len/cap bar:", len(bar), cap(bar))
println("foo[3]:", foo[3])
println("sum foo:", sum(foo))