Skip to content

go-zoox/waitgroup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WaitGroup - Parallel-Controlled WaitGroup

PkgGoDev Build Status Go Report Card Coverage Status GitHub issues Release

Installation

To install the package, run:

go get github.com/go-zoox/waitgroup

Getting Started

import (
  "testing"
  "github.com/go-zoox/waitgroup"
)

func main(t *testing.T) {
  wg := waitgroup.New(3)
  jobs := []func(){}

  for i := 0; i < 10; i++ {
    index := i
    jobs = append(jobs, func() {
      time.Sleep(time.Second)
      fmt.Println(index)
    })
  }

  wg.Add(jobs...)
  
  wg.Wait()
}

Related

License

GoZoox is released under the MIT License.

About

Parallel-Controlled WaitGroup

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages