mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
doc/progs: gofmt -w
R=r, gri, r CC=golang-dev https://golang.org/cl/4662085
This commit is contained in:
parent
e86d727e60
commit
ab3365d34e
13 changed files with 57 additions and 60 deletions
|
|
@ -7,8 +7,8 @@ package main
|
|||
import "fmt"
|
||||
|
||||
type request struct {
|
||||
a, b int
|
||||
replyc chan int
|
||||
a, b int
|
||||
replyc chan int
|
||||
}
|
||||
|
||||
type binOp func(a, b int) int
|
||||
|
|
@ -22,7 +22,7 @@ func server(op binOp, service chan *request, quit chan bool) {
|
|||
for {
|
||||
select {
|
||||
case req := <-service:
|
||||
go run(op, req) // don't wait for it
|
||||
go run(op, req) // don't wait for it
|
||||
case <-quit:
|
||||
return
|
||||
}
|
||||
|
|
@ -47,8 +47,8 @@ func main() {
|
|||
req.replyc = make(chan int)
|
||||
adder <- req
|
||||
}
|
||||
for i := N-1; i >= 0; i-- { // doesn't matter what order
|
||||
if <-reqs[i].replyc != N + 2*i {
|
||||
for i := N - 1; i >= 0; i-- { // doesn't matter what order
|
||||
if <-reqs[i].replyc != N+2*i {
|
||||
fmt.Println("fail at", i)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue