summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/main.go b/main.go
index c955fde..08646a7 100644
--- a/main.go
+++ b/main.go
@@ -2,6 +2,7 @@ package main
import (
"flag"
+ "fmt"
"sync"
"time"
)
@@ -15,6 +16,7 @@ func main() {
flag.Parse()
forks := NewForks(len(names))
+ reports := make(chan string)
wg := sync.WaitGroup{}
for i, name := range names {
@@ -26,11 +28,18 @@ func main() {
Rounds: *rounds,
MaxDelay: *maxDelay,
TimeOut: *timeOut,
+ Report: reports,
}
go func() {
p.Dine()
wg.Done()
}()
}
- wg.Wait()
+ go func() {
+ wg.Wait()
+ close(reports)
+ }()
+ for v := range reports {
+ fmt.Println(v)
+ }
}