diff options
Diffstat (limited to 'test/range.go')
| -rw-r--r-- | test/range.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/range.go b/test/range.go index 91ccd6307..b0f3ae605 100644 --- a/test/range.go +++ b/test/range.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test the 'for range' construct. + package main // test range over channels @@ -172,7 +174,7 @@ func makestring() string { } func teststring() { - s := 0 + var s rune nmake = 0 for _, v := range makestring() { s += v @@ -208,7 +210,7 @@ func teststring1() { func makemap() map[int]int { nmake++ - return map[int]int{0:'a', 1:'b', 2:'c', 3:'d', 4:'☺'} + return map[int]int{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: '☺'} } func testmap() { |
