From 611bda0fb970938487d6390fcf411d0281d236ba Mon Sep 17 00:00:00 2001 From: murmur-wheel Date: Thu, 6 Feb 2020 12:57:51 +0800 Subject: [PATCH] Update object-pool.md Because the type of p at line 29 is"*chan *Object" , so at line 32, 35 should use *p instead of p directly. --- creational/object-pool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/creational/object-pool.md b/creational/object-pool.md index c50667d..8accce7 100644 --- a/creational/object-pool.md +++ b/creational/object-pool.md @@ -29,10 +29,10 @@ Given below is a simple lifecycle example on an object pool. p := pool.New(2) select { -case obj := <-p: +case obj := <-*p: obj.Do( /*...*/ ) - p <- obj + *p <- obj default: // No more objects left — retry later or fail return