Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sizedwaitgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func New(limit int) SizedWaitGroup {
Size: size,

current: make(chan struct{}, size),
wg: sync.WaitGroup{},
}
}

Expand All @@ -48,7 +47,8 @@ func New(limit int) SizedWaitGroup {
//
// See sync.WaitGroup documentation for more information.
func (s *SizedWaitGroup) Add() {
s.AddWithContext(context.Background())
s.current <- struct{}{}
s.wg.Add(1)
}

// AddWithContext increments the internal WaitGroup counter.
Expand Down