From ec0b192e485c8ccefa34c977a95a81553116a864 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Thu, 30 May 2019 06:12:09 -0700 Subject: [PATCH] Rename waitgroup-->waitgroups --- examples.txt | 2 +- .../channel-synchronization.go | 2 +- .../channel-synchronization.hash | 4 ++-- examples/waitgroup/waitgroup.hash | 2 -- .../waitgroup.go => waitgroups/waitgroups.go} | 0 examples/waitgroups/waitgroups.hash | 2 ++ .../waitgroup.sh => waitgroups/waitgroups.sh} | 2 +- examples/worker-pools/worker-pools.go | 2 +- examples/worker-pools/worker-pools.hash | 4 ++-- public/channel-synchronization | 4 ++-- public/index.html | 2 +- public/{waitgroup => waitgroups} | 18 +++++++++--------- public/worker-pools | 6 +++--- 13 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 examples/waitgroup/waitgroup.hash rename examples/{waitgroup/waitgroup.go => waitgroups/waitgroups.go} (100%) create mode 100644 examples/waitgroups/waitgroups.hash rename examples/{waitgroup/waitgroup.sh => waitgroups/waitgroups.sh} (91%) rename public/{waitgroup => waitgroups} (92%) diff --git a/examples.txt b/examples.txt index 6153867..ddace2d 100644 --- a/examples.txt +++ b/examples.txt @@ -32,7 +32,7 @@ Range over Channels Timers Tickers Worker Pools -WaitGroup +WaitGroups Rate Limiting Atomic Counters Mutexes diff --git a/examples/channel-synchronization/channel-synchronization.go b/examples/channel-synchronization/channel-synchronization.go index a9638ee..66873a8 100644 --- a/examples/channel-synchronization/channel-synchronization.go +++ b/examples/channel-synchronization/channel-synchronization.go @@ -2,7 +2,7 @@ // across goroutines. Here's an example of using a // blocking receive to wait for a goroutine to finish. // When waiting for multiple goroutines to finish, -// you may prefer to use a [WaitGroup](waiting-for-goroutines-to-finish). +// you may prefer to use a [WaitGroup](waitgroups). package main diff --git a/examples/channel-synchronization/channel-synchronization.hash b/examples/channel-synchronization/channel-synchronization.hash index 8fba20d..e906123 100644 --- a/examples/channel-synchronization/channel-synchronization.hash +++ b/examples/channel-synchronization/channel-synchronization.hash @@ -1,2 +1,2 @@ -df90432a53832c045472981a9da23d1139fb2b5c -f6qTtt1agmN +eb022977181884c2ab0f2b69e50311769e67a509 +8lmP8beav0p diff --git a/examples/waitgroup/waitgroup.hash b/examples/waitgroup/waitgroup.hash deleted file mode 100644 index 1df8a2f..0000000 --- a/examples/waitgroup/waitgroup.hash +++ /dev/null @@ -1,2 +0,0 @@ -ffc6520e73ebfa2b8c470e3ef00fee55388234e0 -8cD2V9CgI0J diff --git a/examples/waitgroup/waitgroup.go b/examples/waitgroups/waitgroups.go similarity index 100% rename from examples/waitgroup/waitgroup.go rename to examples/waitgroups/waitgroups.go diff --git a/examples/waitgroups/waitgroups.hash b/examples/waitgroups/waitgroups.hash new file mode 100644 index 0000000..71ecfc8 --- /dev/null +++ b/examples/waitgroups/waitgroups.hash @@ -0,0 +1,2 @@ +499c7ee59b2ae06d2d3171768d9cf11762121a87 +gLLmgcR7YkP diff --git a/examples/waitgroup/waitgroup.sh b/examples/waitgroups/waitgroups.sh similarity index 91% rename from examples/waitgroup/waitgroup.sh rename to examples/waitgroups/waitgroups.sh index 13293bc..c2a6c11 100644 --- a/examples/waitgroup/waitgroup.sh +++ b/examples/waitgroups/waitgroups.sh @@ -1,4 +1,4 @@ -$ go run waitgroup.go +$ go run waitgroups.go Worker 5 starting Worker 3 starting Worker 4 starting diff --git a/examples/worker-pools/worker-pools.go b/examples/worker-pools/worker-pools.go index 32ce2f7..eabda7a 100644 --- a/examples/worker-pools/worker-pools.go +++ b/examples/worker-pools/worker-pools.go @@ -44,7 +44,7 @@ func main() { // Finally we collect all the results of the work. // This also ensures that the worker goroutines have // finished. An alternative way to wait for multiple - // goroutines is to use a [WaitGroup](waitgroup). + // goroutines is to use a [WaitGroup](waitgroups). for a := 1; a <= 5; a++ { <-results } diff --git a/examples/worker-pools/worker-pools.hash b/examples/worker-pools/worker-pools.hash index 4a9a3a2..9f101b7 100644 --- a/examples/worker-pools/worker-pools.hash +++ b/examples/worker-pools/worker-pools.hash @@ -1,2 +1,2 @@ -3f7712d470dcbfc0cdddc939bb80814baaff8bb0 -Q5r-XtrWWL- +bc69c6602d438413dcb9ceac112299ee253e4575 +yuHsGf712D1 diff --git a/public/channel-synchronization b/public/channel-synchronization index e79fe04..307251a 100644 --- a/public/channel-synchronization +++ b/public/channel-synchronization @@ -29,7 +29,7 @@ across goroutines. Here’s an example of using a blocking receive to wait for a goroutine to finish. When waiting for multiple goroutines to finish, -you may prefer to use a WaitGroup.

+you may prefer to use a WaitGroup.

@@ -43,7 +43,7 @@ you may prefer to use a WaitGroup - +
package main
 
diff --git a/public/index.html b/public/index.html index d4dd0a2..347a8a3 100644 --- a/public/index.html +++ b/public/index.html @@ -103,7 +103,7 @@
  • Worker Pools
  • -
  • WaitGroup
  • +
  • WaitGroups
  • Rate Limiting
  • diff --git a/public/waitgroup b/public/waitgroups similarity index 92% rename from public/waitgroup rename to public/waitgroups index bdd3b66..7648b36 100644 --- a/public/waitgroup +++ b/public/waitgroups @@ -2,7 +2,7 @@ - Go by Example: WaitGroup + Go by Example: WaitGroups -
    -

    Go by Example: WaitGroup

    +
    +

    Go by Example: WaitGroups

    @@ -40,7 +40,7 @@ use a wait group.

    @@ -152,7 +152,7 @@ counter for each.

    @@ -175,7 +175,7 @@ all the workers notified they’re done.

    - +
    package main
     
    @@ -95,7 +95,7 @@ pointer.

    -

    Notify the WaitGroup that we’re done.

    +

    Notify the WaitGroup that this worker is done.

    @@ -135,7 +135,7 @@ goroutines launched here to finish.

    -

    Launch several goroutines and increment the WorkGroup +

    Launch several goroutines and increment the WaitGroup counter for each.

    -

    Block until the WorkGroup counter goes back to 0; +

    Block until the WaitGroup counter goes back to 0; all the workers notified they’re done.

    -
    $ go run waitgroup.go
    +            
    $ go run waitgroups.go
     Worker 5 starting
     Worker 3 starting
     Worker 4 starting
    @@ -211,7 +211,7 @@ is likely to be different for each invocation.

    diff --git a/public/worker-pools b/public/worker-pools index 90f35eb..5762746 100644 --- a/public/worker-pools +++ b/public/worker-pools @@ -40,7 +40,7 @@ a worker pool using goroutines and channels.

    - +
    package main
     
    @@ -150,7 +150,7 @@ channel to indicate that’s all the work we have.

    Finally we collect all the results of the work. This also ensures that the worker goroutines have finished. An alternative way to wait for multiple -goroutines is to use a WaitGroup.

    +goroutines is to use a WaitGroup.

    @@ -210,7 +210,7 @@ there are 3 workers operating concurrently.

    - Next example: WaitGroup. + Next example: WaitGroups.