mirror of
https://github.com/golang/go
synced 2024-11-23 16:10:05 -07:00
src, misc: applied gofmt -s -w
Pending CL 113120043. LGTM=dave R=golang-codereviews, dave CC=golang-codereviews https://golang.org/cl/112290043
This commit is contained in:
parent
8d504c4e97
commit
8a23c0021e
@ -1016,7 +1016,7 @@ func forFieldList(fl *ast.FieldList, fn func(int, ast.Expr)) {
|
||||
fn(i, r.Type)
|
||||
i++
|
||||
} else {
|
||||
for _ = range r.Names {
|
||||
for range r.Names {
|
||||
fn(i, r.Type)
|
||||
i++
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ func TestUnreadRuneError(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error("unexpected error on ReadRune (2):", err)
|
||||
}
|
||||
for _ = range buf {
|
||||
for range buf {
|
||||
_, err = r.ReadByte()
|
||||
if err != nil {
|
||||
t.Error("unexpected error on ReadByte (2):", err)
|
||||
|
@ -580,7 +580,7 @@ func (db *DB) maybeOpenNewConnections() {
|
||||
|
||||
// Runs in a separate goroutine, opens new connections when requested.
|
||||
func (db *DB) connectionOpener() {
|
||||
for _ = range db.openerCh {
|
||||
for range db.openerCh {
|
||||
db.openNewConnection()
|
||||
}
|
||||
}
|
||||
|
@ -1708,7 +1708,7 @@ func doConcurrentTest(t testing.TB, ct concurrentTest) {
|
||||
|
||||
for i := 0; i < maxProcs*2; i++ {
|
||||
go func() {
|
||||
for _ = range reqs {
|
||||
for range reqs {
|
||||
err := ct.test(t)
|
||||
if err != nil {
|
||||
wg.Done()
|
||||
@ -1750,7 +1750,7 @@ func manyConcurrentQueries(t testing.TB) {
|
||||
|
||||
for i := 0; i < maxProcs*2; i++ {
|
||||
go func() {
|
||||
for _ = range reqs {
|
||||
for range reqs {
|
||||
rows, err := stmt.Query()
|
||||
if err != nil {
|
||||
t.Errorf("error on query: %v", err)
|
||||
|
@ -357,7 +357,7 @@ func idents(f *ast.File) <-chan *ast.Ident {
|
||||
// identCount returns the number of identifiers found in f.
|
||||
func identCount(f *ast.File) int {
|
||||
n := 0
|
||||
for _ = range idents(f) {
|
||||
for range idents(f) {
|
||||
n++
|
||||
}
|
||||
return n
|
||||
|
@ -314,7 +314,7 @@ func TestConcurrentReconnect(t *testing.T) {
|
||||
count := make(chan int)
|
||||
go func() {
|
||||
ct := 0
|
||||
for _ = range done {
|
||||
for range done {
|
||||
ct++
|
||||
// we are looking for 500 out of 1000 events
|
||||
// here because lots of log messages are lost
|
||||
|
@ -488,7 +488,7 @@ func TestDialDualStackLocalhost(t *testing.T) {
|
||||
}
|
||||
|
||||
d := &Dialer{DualStack: true}
|
||||
for _ = range dss.lns {
|
||||
for range dss.lns {
|
||||
if c, err := d.Dial("tcp", "localhost:"+dss.port); err != nil {
|
||||
t.Errorf("Dial failed: %v", err)
|
||||
} else {
|
||||
|
@ -358,7 +358,7 @@ func (c *Cmd) Wait() error {
|
||||
c.ProcessState = state
|
||||
|
||||
var copyError error
|
||||
for _ = range c.goroutine {
|
||||
for range c.goroutine {
|
||||
if err := <-c.errch; err != nil && copyError == nil {
|
||||
copyError = err
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ func BenchmarkGoroutineBlocking(b *testing.B) {
|
||||
|
||||
func BenchmarkGoroutineForRange(b *testing.B) {
|
||||
read := func(ch chan struct{}) {
|
||||
for _ = range ch {
|
||||
for range ch {
|
||||
}
|
||||
}
|
||||
benchHelper(b, *n, read)
|
||||
|
@ -253,7 +253,7 @@ func testConcurrentReadsAfterGrowth(t *testing.T, useReflect bool) {
|
||||
for nr := 0; nr < numReader; nr++ {
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for _ = range m {
|
||||
for range m {
|
||||
}
|
||||
}()
|
||||
go func() {
|
||||
|
@ -241,7 +241,7 @@ func BenchmarkMapIter(b *testing.B) {
|
||||
}
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for _ = range m {
|
||||
for range m {
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -250,7 +250,7 @@ func BenchmarkMapIterEmpty(b *testing.B) {
|
||||
m := make(map[int]bool)
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for _ = range m {
|
||||
for range m {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
4
src/pkg/runtime/race/testdata/chan_test.go
vendored
4
src/pkg/runtime/race/testdata/chan_test.go
vendored
@ -88,7 +88,7 @@ func TestNoRaceChanAsyncCloseRecv3(t *testing.T) {
|
||||
v = 1
|
||||
close(c)
|
||||
}()
|
||||
for _ = range c {
|
||||
for range c {
|
||||
}
|
||||
v = 2
|
||||
}
|
||||
@ -127,7 +127,7 @@ func TestNoRaceChanSyncCloseRecv3(t *testing.T) {
|
||||
v = 1
|
||||
close(c)
|
||||
}()
|
||||
for _ = range c {
|
||||
for range c {
|
||||
}
|
||||
v = 2
|
||||
}
|
||||
|
8
src/pkg/runtime/race/testdata/map_test.go
vendored
8
src/pkg/runtime/race/testdata/map_test.go
vendored
@ -57,7 +57,7 @@ func TestRaceMapRange(t *testing.T) {
|
||||
m := make(map[int]int)
|
||||
ch := make(chan bool, 1)
|
||||
go func() {
|
||||
for _ = range m {
|
||||
for range m {
|
||||
}
|
||||
ch <- true
|
||||
}()
|
||||
@ -69,7 +69,7 @@ func TestRaceMapRange2(t *testing.T) {
|
||||
m := make(map[int]int)
|
||||
ch := make(chan bool, 1)
|
||||
go func() {
|
||||
for _ = range m {
|
||||
for range m {
|
||||
}
|
||||
ch <- true
|
||||
}()
|
||||
@ -85,11 +85,11 @@ func TestNoRaceMapRangeRange(t *testing.T) {
|
||||
m[0] = 0
|
||||
ch := make(chan bool, 1)
|
||||
go func() {
|
||||
for _ = range m {
|
||||
for range m {
|
||||
}
|
||||
ch <- true
|
||||
}()
|
||||
for _ = range m {
|
||||
for range m {
|
||||
}
|
||||
<-ch
|
||||
}
|
||||
|
10
src/pkg/runtime/race/testdata/slice_test.go
vendored
10
src/pkg/runtime/race/testdata/slice_test.go
vendored
@ -198,7 +198,7 @@ func TestNoRaceStructSlicesRangeWrite(t *testing.T) {
|
||||
s.a = make([]int, 10)
|
||||
s.b = make([]int, 10)
|
||||
go func() {
|
||||
for _ = range s.a {
|
||||
for range s.a {
|
||||
}
|
||||
ch <- true
|
||||
}()
|
||||
@ -240,7 +240,7 @@ func TestNoRaceSliceRangeWrite(t *testing.T) {
|
||||
s[3] = 3
|
||||
c <- true
|
||||
}()
|
||||
for _ = range s {
|
||||
for range s {
|
||||
}
|
||||
<-c
|
||||
}
|
||||
@ -252,7 +252,7 @@ func TestRaceSliceRangeAppend(t *testing.T) {
|
||||
s = append(s, 3)
|
||||
c <- true
|
||||
}()
|
||||
for _ = range s {
|
||||
for range s {
|
||||
}
|
||||
<-c
|
||||
}
|
||||
@ -264,7 +264,7 @@ func TestNoRaceSliceRangeAppend(t *testing.T) {
|
||||
_ = append(s, 3)
|
||||
c <- true
|
||||
}()
|
||||
for _ = range s {
|
||||
for range s {
|
||||
}
|
||||
<-c
|
||||
}
|
||||
@ -295,7 +295,7 @@ func TestRaceSliceVarRange(t *testing.T) {
|
||||
c := make(chan bool, 1)
|
||||
s := make([]int, 10)
|
||||
go func() {
|
||||
for _ = range s {
|
||||
for range s {
|
||||
}
|
||||
c <- true
|
||||
}()
|
||||
|
@ -85,7 +85,7 @@ func BenchmarkRuneIterate(b *testing.B) {
|
||||
}
|
||||
s := string(bytes)
|
||||
for i := 0; i < b.N; i++ {
|
||||
for _ = range s {
|
||||
for range s {
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -97,7 +97,7 @@ func BenchmarkRuneIterate2(b *testing.B) {
|
||||
}
|
||||
s := string(bytes)
|
||||
for i := 0; i < b.N; i++ {
|
||||
for _ = range s {
|
||||
for range s {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ func RuneCount(p []byte) int {
|
||||
|
||||
// RuneCountInString is like RuneCount but its input is a string.
|
||||
func RuneCountInString(s string) (n int) {
|
||||
for _ = range s {
|
||||
for range s {
|
||||
n++
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user