From: Ian Lance Taylor Date: Fri, 9 Jan 2009 23:13:26 +0000 (-0800) Subject: Use make instead of new to allocate a channel. X-Git-Tag: weekly.2009-11-06~2397 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=dfc3e52310dfe43534a9522b6ef4c870f76bd7d6;p=gostls13.git Use make instead of new to allocate a channel. R=r DELTA=2 (0 added, 0 deleted, 2 changed) OCL=22452 CL=22455 --- diff --git a/doc/progs/server.go b/doc/progs/server.go index 7a21e43963..cdf2b2e8cf 100644 --- a/doc/progs/server.go +++ b/doc/progs/server.go @@ -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