From befc40a4e68bd0af08b6e8020598c85a9c235665 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 30 Jan 2009 14:39:31 -0800 Subject: update go code tree to new func rules. R=r DELTA=367 (111 added, 59 deleted, 197 changed) OCL=23957 CL=23960 --- doc/progs/server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/progs/server.go') diff --git a/doc/progs/server.go b/doc/progs/server.go index c3f772bf9..459245316 100644 --- a/doc/progs/server.go +++ b/doc/progs/server.go @@ -9,21 +9,21 @@ type request struct { replyc chan int; } -type binOp (a, b int) int; +type binOp func(a, b int) int; -func run(op *binOp, req *request) { +func run(op binOp, req *request) { reply := op(req.a, req.b); req.replyc <- reply; } -func server(op *binOp, service chan *request) { +func server(op binOp, service chan *request) { for { req := <-service; go run(op, req); // don't wait for it } } -func startServer(op *binOp) chan *request { +func startServer(op binOp) chan *request { req := make(chan *request); go server(op, req); return req; -- cgit v1.2.3