aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Hitchman <hitchmanr@gmail.com>2010-12-08 21:36:56 -0800
committerRobert Griesemer <gri@golang.org>2010-12-08 21:36:56 -0800
commit062406bc644f1606a2c0fa6f0e25ac04aebfd55e (patch)
treeb4aa502a43b4ded39abcbe5a1abad1391c52dc39 /src
parent14804a412b30d561ee63a15735ef21c75c77df89 (diff)
downloadgo-062406bc644f1606a2c0fa6f0e25ac04aebfd55e.tar.xz
throughout: simplify two-variable ranges with unused second variable
R=golang-dev, gri CC=golang-dev https://golang.org/cl/3529041
Diffstat (limited to 'src')
-rw-r--r--src/cmd/godoc/godoc.go2
-rw-r--r--src/pkg/container/vector/numbers_test.go2
-rw-r--r--src/pkg/exp/draw/draw.go2
-rw-r--r--src/pkg/go/parser/parser_test.go2
-rw-r--r--src/pkg/http/transfer.go2
-rw-r--r--src/pkg/index/suffixarray/suffixarray.go2
-rw-r--r--src/pkg/reflect/type.go2
-rw-r--r--src/pkg/unicode/maketables.go4
8 files changed, 9 insertions, 9 deletions
diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go
index 8fce6cd213..ff51c4dd86 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 a44242f67b..93335ca60f 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 2f3139d69b..c94ae83a42 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 9c9a428b87..56bd80ef1f 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 75030e87df..e62885d62f 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 4839dbb146..2d728e2c3a 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 d87ccc984c..9a7467b32d 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 c8e7eb4420..081e1a1198 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")