From 7fba0583f1ba808589aa735aff4c68393050278a Mon Sep 17 00:00:00 2001 From: Matt Hickford Date: Tue, 17 Jun 2014 20:11:36 +0100 Subject: [PATCH] Fix error ".\about_allocation.go:18: negative cap argument in make([]int)" --- about_allocation.go | 2 +- setup_koans_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/about_allocation.go b/about_allocation.go index 185a33a..3d09ee8 100644 --- a/about_allocation.go +++ b/about_allocation.go @@ -15,7 +15,7 @@ func aboutAllocation() { slice := make([]int, 3) assert(len(slice) == __int__) // make() creates slices of a given length - slice = make([]int, 3, __int__) // but can also take an optional capacity + slice = make([]int, 3, __positive_int__) // but can also take an optional capacity assert(cap(slice) == 20) m := make(map[int]string) diff --git a/setup_koans_test.go b/setup_koans_test.go index 4dcd709..26c3bc1 100644 --- a/setup_koans_test.go +++ b/setup_koans_test.go @@ -13,6 +13,7 @@ import ( const ( __string__ string = "impossibly lame value" __int__ int = -1 + __positive_int__ int = 42 __byte__ byte = 255 __bool__ bool = false // ugh __boolean__ bool = true // oh well