1
0
mirror of https://github.com/golang/go synced 2024-11-21 18:54:43 -07:00

Use make instead of new to allocate a channel.

R=r
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=22452
CL=22455
This commit is contained in:
Ian Lance Taylor 2009-01-09 15:13:26 -08:00
parent 316d377ac2
commit dfc3e52310

View File

@ -24,7 +24,7 @@ func Server(op *BinOp, service chan *Request) {
}
func StartServer(op *BinOp) chan *Request {
req := new(chan *Request);
req := make(chan *Request);
go Server(op, req);
return req;
}
@ -37,7 +37,7 @@ func main() {
req := &reqs[i];
req.a = i;
req.b = i + N;
req.replyc = new(chan int);
req.replyc = make(chan int);
adder <- req;
}
for i := N-1; i >= 0; i-- { // doesn't matter what order