From: Bjørn Erik Pedersen Date: Thu, 24 Mar 2016 18:57:26 +0000 (+0100) Subject: Be explicit about the type in Scratch test X-Git-Tag: v0.16~161 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6dbae7b67154f864b29ea90646f78f15c96db5f2;p=brevno-suite%2Fhugo Be explicit about the type in Scratch test A puzzle, but it sometimes produces a int64 as it is now. --- diff --git a/hugolib/scratch_test.go b/hugolib/scratch_test.go index 8bc5db01..e7b04d3a 100644 --- a/hugolib/scratch_test.go +++ b/hugolib/scratch_test.go @@ -88,12 +88,12 @@ func TestScratchInParallel(t *testing.T) { var wg sync.WaitGroup scratch := newScratch() key := "counter" - scratch.Set(key, 1) + scratch.Set(key, int64(1)) for i := 1; i <= 10; i++ { wg.Add(1) go func(j int) { for k := 0; k < 10; k++ { - newVal := k + j + newVal := int64(k + j) _, err := scratch.Add(key, newVal) if err != nil { @@ -104,7 +104,7 @@ func TestScratchInParallel(t *testing.T) { val := scratch.Get(key) - if counter, ok := val.(int); ok { + if counter, ok := val.(int64); ok { if counter < 1 { t.Errorf("Got %d", counter) }