Skip to content

Commit

Permalink
move line WaitGroup.Done
Browse files Browse the repository at this point in the history
  • Loading branch information
hichtakk committed Apr 28, 2016
1 parent bad4163 commit 1feae06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tarpan.go
Expand Up @@ -259,6 +259,7 @@ func Collect(dataset *DataSet) []*TarpanResult {

waitGroup.Add(1)
go func(ds *DataSet, idx int, o []string, c *Channels) {
defer waitGroup.Done()
c.semaphoe <- 0
req_body, req_body_err := makeRequestBody(ds, idx)
if req_body_err != nil {
Expand All @@ -281,7 +282,6 @@ func Collect(dataset *DataSet) []*TarpanResult {
}
c.results <- ret
<-c.semaphoe
waitGroup.Done()
}(dataset, index, oids, channels)
}
waitGroup.Wait()
Expand Down

0 comments on commit 1feae06

Please sign in to comment.