diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go index 8fce6cd2131..ff51c4dd86c 100644 --- a/src/cmd/godoc/godoc.go +++ b/src/cmd/godoc/godoc.go @@ -1182,7 +1182,7 @@ func (h *httpHandler) getPageInfo(abspath, relpath, pkgname string, mode PageInf // (excluding the selected package, if any). plist = make([]string, len(pkgs)) i := 0 - for name, _ := range pkgs { + for name := range pkgs { if pkg == nil || name != pkg.Name { plist[i] = name i++ diff --git a/src/pkg/container/vector/numbers_test.go b/src/pkg/container/vector/numbers_test.go index a44242f67b6..93335ca60f2 100644 --- a/src/pkg/container/vector/numbers_test.go +++ b/src/pkg/container/vector/numbers_test.go @@ -20,7 +20,7 @@ func s(n uint64) string { lens := len(str) a := make([]string, (lens+2)/3) start := lens - for i, _ := range a { + for i := range a { start -= 3 if start < 0 { start = 0 diff --git a/src/pkg/exp/draw/draw.go b/src/pkg/exp/draw/draw.go index 2f3139d69b4..c94ae83a427 100644 --- a/src/pkg/exp/draw/draw.go +++ b/src/pkg/exp/draw/draw.go @@ -268,7 +268,7 @@ func drawFillSrc(dst *image.RGBA, r image.Rectangle, src *image.ColorImage) { dbase := dy0 * dst.Stride i0, i1 := dbase+dx0, dbase+dx1 firstRow := dst.Pix[i0:i1] - for i, _ := range firstRow { + for i := range firstRow { firstRow[i] = color } for y := dy0 + 1; y < dy1; y++ { diff --git a/src/pkg/go/parser/parser_test.go b/src/pkg/go/parser/parser_test.go index 9c9a428b877..56bd80ef1fc 100644 --- a/src/pkg/go/parser/parser_test.go +++ b/src/pkg/go/parser/parser_test.go @@ -104,7 +104,7 @@ func TestParse4(t *testing.T) { t.Errorf(`package "parser" not found`) return } - for filename, _ := range pkg.Files { + for filename := range pkg.Files { if !nameFilter(filename) { t.Errorf("unexpected package file: %s", filename) } diff --git a/src/pkg/http/transfer.go b/src/pkg/http/transfer.go index 75030e87dfb..e62885d62fd 100644 --- a/src/pkg/http/transfer.go +++ b/src/pkg/http/transfer.go @@ -108,7 +108,7 @@ func (t *transferWriter) WriteHeader(w io.Writer) (err os.Error) { // writing long headers, using HTTP line splitting io.WriteString(w, "Trailer: ") needComma := false - for k, _ := range t.Trailer { + for k := range t.Trailer { k = CanonicalHeaderKey(k) switch k { case "Transfer-Encoding", "Trailer", "Content-Length": diff --git a/src/pkg/index/suffixarray/suffixarray.go b/src/pkg/index/suffixarray/suffixarray.go index 4839dbb146a..2d728e2c3ae 100644 --- a/src/pkg/index/suffixarray/suffixarray.go +++ b/src/pkg/index/suffixarray/suffixarray.go @@ -40,7 +40,7 @@ type Index struct { // func New(data []byte) *Index { sa := make([]int, len(data)) - for i, _ := range sa { + for i := range sa { sa[i] = i } x := &Index{data, sa} diff --git a/src/pkg/reflect/type.go b/src/pkg/reflect/type.go index d87ccc984c3..9a7467b32d6 100644 --- a/src/pkg/reflect/type.go +++ b/src/pkg/reflect/type.go @@ -550,7 +550,7 @@ func (t *StructType) fieldByNameFunc(match func(string) bool, mark map[*StructTy var fi int // field index n := 0 // number of matching fields at depth fd L: - for i, _ := range t.fields { + for i := range t.fields { f := t.Field(i) d := inf switch { diff --git a/src/pkg/unicode/maketables.go b/src/pkg/unicode/maketables.go index c8e7eb44200..081e1a1198f 100644 --- a/src/pkg/unicode/maketables.go +++ b/src/pkg/unicode/maketables.go @@ -326,7 +326,7 @@ func printCategories() { if *tablelist == "all" { fmt.Println("// Categories is the set of Unicode data tables.") fmt.Println("var Categories = map[string] []Range {") - for k, _ := range category { + for k := range category { fmt.Printf("\t%q: %s,\n", k, k) } fmt.Print("}\n\n") @@ -594,7 +594,7 @@ func printScriptOrProperty(doProps bool) { fmt.Println("// Scripts is the set of Unicode script tables.") fmt.Println("var Scripts = map[string] []Range {") } - for k, _ := range table { + for k := range table { fmt.Printf("\t%q: %s,\n", k, k) } fmt.Print("}\n\n") diff --git a/test/blank.go b/test/blank.go index b9d3a32a817..6e69f8aaaeb 100644 --- a/test/blank.go +++ b/test/blank.go @@ -77,7 +77,7 @@ func main() { if out != "123" {panic(out)} sum := 0 - for s, _ := range ints { + for s := range ints { sum += s } if sum != 3 {panic(sum)}