Skip to content

Commit 083841f

Browse files
authored
Merge pull request #204 from mailgun/amock/fix-example
Fix syncutils -> syncutil
1 parent 4c3ed06 commit 083841f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Waitgroup is a simplification of `sync.Waitgroup` with item and error collection
3030

3131
Running many short term routines over a collection with `.Run()`
3232
```go
33-
import "github.com/mailgun/holster/v4/syncutils"
34-
var wg syncutils.WaitGroup
33+
import "github.com/mailgun/holster/v4/syncutil"
34+
var wg syncutil.WaitGroup
3535
for _, item := range items {
3636
wg.Run(func(item interface{}) error {
3737
// Do some long running thing with the item
@@ -47,9 +47,9 @@ if errs != nil {
4747

4848
Clean up long running routines easily with `.Loop()`
4949
```go
50-
import "github.com/mailgun/holster/v4/syncutils"
50+
import "github.com/mailgun/holster/v4/syncutil"
5151
pipe := make(chan int32, 0)
52-
var wg syncutils.WaitGroup
52+
var wg syncutil.WaitGroup
5353
var count int32
5454

5555
wg.Loop(func() bool {
@@ -76,8 +76,8 @@ wg.Wait()
7676

7777
Loop `.Until()` `.Stop()` is called
7878
```go
79-
import "github.com/mailgun/holster/v4/syncutils"
80-
var wg syncutils.WaitGroup
79+
import "github.com/mailgun/holster/v4/syncutil"
80+
var wg syncutil.WaitGroup
8181

8282
wg.Until(func(done chan struct{}) bool {
8383
select {
@@ -101,9 +101,9 @@ collects any errors from the routines once they have all completed. FanOut allow
101101
to control how many goroutines spawn at a time while WaitGroup will not.
102102

103103
```go
104-
import "github.com/mailgun/holster/v4/syncutils"
104+
import "github.com/mailgun/holster/v4/syncutil"
105105
// Insert records into the database 10 at a time
106-
fanOut := syncutils.NewFanOut(10)
106+
fanOut := syncutil.NewFanOut(10)
107107
for _, item := range items {
108108
fanOut.Run(func(cast interface{}) error {
109109
item := cast.(Item)

0 commit comments

Comments
 (0)