Skip to content

Instantly share code, notes, and snippets.

@westonplatter
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save westonplatter/4aa6ead8e9322ece8183 to your computer and use it in GitHub Desktop.

Select an option

Save westonplatter/4aa6ead8e9322ece8183 to your computer and use it in GitHub Desktop.
var wg sync.WaitGroup
numWorkers := 10
inputChannel := make(chan []string)
for i := 0; i < numWorkers; i++ {
wg.Add(1)
go func() {
for data := range inputChannel {
// do work
}
wg.Done()
}()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment