Update to gobook@9158e92c5bbd7764011107a1be0c3e2dc5d78d9b

Change-Id: I54d6751b9d56cab2ec9926a086f9d0eb08a19596
This commit is contained in:
Alan Donovan 2016-03-01 14:15:44 -05:00
parent c8852cb2da
commit 7cc6a2956e

View File

@ -68,6 +68,7 @@ func Sequential(t *testing.T, m M) {
value, err := m.Get(url)
if err != nil {
log.Print(err)
continue
}
fmt.Printf("%s, %s, %d bytes\n",
url, time.Since(start), len(value.([]byte)))
@ -87,14 +88,15 @@ func Concurrent(t *testing.T, m M) {
for url := range incomingURLs() {
n.Add(1)
go func(url string) {
defer n.Done()
start := time.Now()
value, err := m.Get(url)
if err != nil {
log.Print(err)
return
}
fmt.Printf("%s, %s, %d bytes\n",
url, time.Since(start), len(value.([]byte)))
n.Done()
}(url)
}
n.Wait()