From 0562353fd98cdde650c91aca6cc227a95f422dff Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Mon, 3 Dec 2018 10:13:53 +0800 Subject: [PATCH] integrating with http-server --- README.md | 4 ++-- README_ZH.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2f3786e..38f287b 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ type Request struct { func main() { pool, _ := ants.NewPoolWithFunc(100, func(payload interface{}) { - request, ok := payload.(Request) + request, ok := payload.(*Request) if !ok { request = Request{Param:[]byte(""), Result: make(chan []byte)} } @@ -141,7 +141,7 @@ func main() { } defer r.Body.Close() - request := Request{Param: param, Result: make(chan []byte)} + request := &Request{Param: param, Result: make(chan []byte)} // Throttle the requests with ants pool. This process is asynchronous and // you can receive a result from the channel defined outside. diff --git a/README_ZH.md b/README_ZH.md index 871dd34..c3ffa88 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -118,7 +118,7 @@ type Request struct { func main() { pool, _ := ants.NewPoolWithFunc(100, func(payload interface{}) { - request, ok := payload.(Request) + request, ok := payload.(*Request) if !ok { request = Request{Param:[]byte(""), Result: make(chan []byte)} } @@ -140,7 +140,7 @@ func main() { } defer r.Body.Close() - request := Request{Param: param, Result: make(chan []byte)} + request := &Request{Param: param, Result: make(chan []byte)} // Throttle the requests with ants pool. This process is asynchronous and // you can receive a result from the channel defined outside.