From 29125be5c7d4f04788669d7ab2a6e555749b9609 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 14 Jul 2011 23:43:03 -0400 Subject: [PATCH] runtime: make TestSideEffectOrder work twice R=golang-dev, adg CC=golang-dev https://golang.org/cl/4714045 --- src/pkg/runtime/append_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/runtime/append_test.go b/src/pkg/runtime/append_test.go index 75a635306b..b8552224e5 100644 --- a/src/pkg/runtime/append_test.go +++ b/src/pkg/runtime/append_test.go @@ -36,7 +36,7 @@ func BenchmarkAppendSpecialCase(b *testing.B) { } } -var x = make([]int, 0, 10) +var x []int func f() int { x[:1][0] = 3 @@ -44,6 +44,7 @@ func f() int { } func TestSideEffectOrder(t *testing.T) { + x = make([]int, 0, 10) x = append(x, 1, f()) if x[0] != 1 || x[1] != 2 { t.Error("append failed: ", x[0], x[1])