]> Cypherpunks repositories - gostls13.git/commit
sync: add example for Pool
authorKevin Burke <kev@inburke.com>
Wed, 22 Jun 2016 17:00:31 +0000 (10:00 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 10 Nov 2016 05:32:14 +0000 (05:32 +0000)
commit9e2c3f4c7e78b01d635e16287789913d02807569
tree36c313f7f8574278f16c27110cceee5cb692d324
parent73497c7656fa55ac33bac960ecee806b9b07ae5e
sync: add example for Pool

It was a little tricky to figure out how to go from the documentation
to figuring out the best way to implement a Pool, so I thought I'd
try to provide a simple example. The implementation is mostly taken
from the fmt package.

I'm not happy with the verbosity of the calls to WriteString() etc,
but I wanted to provide a non-trivial example.

Change-Id: Id33a8b6cbf8eb278f71e1f78e20205b436578606
Reviewed-on: https://go-review.googlesource.com/24371
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/sync/example_pool_test.go [new file with mode: 0644]