You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: example_test.go
+8-11Lines changed: 8 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -47,15 +47,14 @@ func ExampleCsvReader() {
47
47
rowsChans, errsChan:=bigCSV.Read(ctx)
48
48
49
49
// process rows and errors:
50
-
51
50
fori:=rangerowsChans {
52
-
wg.Add(1)
53
-
gorowWorker(rowsChans[i], &wg)
51
+
wg.Go(func() {
52
+
rowWorker(rowsChans[i])
53
+
})
54
54
}
55
-
56
-
wg.Add(1)
57
-
goerrWorker(errsChan, &wg)
58
-
55
+
wg.Go(func() {
56
+
errWorker(errsChan)
57
+
})
59
58
wg.Wait()
60
59
61
60
// Unordered output:
@@ -66,18 +65,16 @@ func ExampleCsvReader() {
66
65
// {ID:5 Name:Logitech Mouse G203 Desc:Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eleifend felis quis magna auctor, ut lacinia eros efficitur. Maecenas mattis dolor a pharetra gravida. Aenean at eros sed metus posuere feugiat in vitae libero. Morbi a diam volutpat, tempor lacus sed, sagittis velit. Donec eget dignissim mauris, sed aliquam ex. Duis eros dolor, vestibulum ac aliquam eget, viverra in enim. Aenean ut turpis quis purus porta lobortis. Etiam sollicitudin lectus vitae velit tincidunt, ut volutpat justo aliquam. Aenean vitae vehicula arcu. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nunc viverra enim nec risus mollis elementum nec dictum ex. Nunc lorem eros, vulputate a rutrum nec, scelerisque non augue. Sed in egestas eros. Quisque felis lorem, vehicula ac venenatis vel, tristique id sapien. Morbi vitae odio eget orci facilisis suscipit. Cras sodales, augue vitae tincidunt tempus, diam turpis volutpat est, vitae fringilla augue leo semper augue. Integer scelerisque tempor mauris, ac posuere sem aenean Price:30.5 Qty:35}
0 commit comments