Skip to content

Commit 6eb73f5

Browse files
committed
doc: fix example errors.
1 parent 65e78a6 commit 6eb73f5

File tree

6 files changed

+7
-16
lines changed

6 files changed

+7
-16
lines changed

all_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func ExampleAllCompleted() {
244244
})
245245
fmt.Println(out)
246246
fmt.Println(err)
247-
// Outputs:
247+
// Output:
248248
// [[1 <nil>] [expected error]]
249249
// function 1 error: expected error
250250
}

parallel_test.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ func BenchmarkParallel(b *testing.B) {
157157
}
158158

159159
func ExampleParallel() {
160-
start := time.Now()
161160
out, err := async.Parallel(2, func() int {
162161
time.Sleep(50 * time.Millisecond)
163162
return 1
@@ -168,11 +167,9 @@ func ExampleParallel() {
168167
time.Sleep(50 * time.Millisecond)
169168
return 3
170169
})
171-
fmt.Println(time.Since(start))
172170
fmt.Println(out)
173171
fmt.Println(err)
174-
// Outputs:
175-
// 101.210974ms
172+
// Output:
176173
// [[1] [2] [3]]
177174
// <nil>
178175
}
@@ -336,7 +333,6 @@ func BenchmarkParallelCompleted(b *testing.B) {
336333
}
337334

338335
func ExampleParallelCompleted() {
339-
start := time.Now()
340336
out, err := async.ParallelCompleted(2, func() int {
341337
time.Sleep(50 * time.Millisecond)
342338
return 1
@@ -347,11 +343,9 @@ func ExampleParallelCompleted() {
347343
time.Sleep(50 * time.Millisecond)
348344
return 3
349345
})
350-
fmt.Println(time.Since(start))
351346
fmt.Println(out)
352347
fmt.Println(err)
353-
// Outputs:
354-
// 101.210974ms
348+
// Output:
355349
// [[1] [expected error] [3]]
356350
// function 1 error: expected error
357351
}

race_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,17 @@ func BenchmarkRace(b *testing.B) {
132132
}
133133

134134
func ExampleRace() {
135-
start := time.Now()
136135
out, index, err := async.Race(func() int {
137136
time.Sleep(50 * time.Millisecond)
138137
return 1
139138
}, func() int {
140139
time.Sleep(20 * time.Millisecond)
141140
return 2
142141
})
143-
fmt.Println(time.Since(start))
144142
fmt.Println(out)
145143
fmt.Println(index)
146144
fmt.Println(err)
147-
// Outputs:
148-
// 20.678486ms
145+
// Output:
149146
// [2]
150147
// 1
151148
// <nil>

retry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func ExampleRetry() {
153153
fmt.Println(i)
154154
fmt.Println(out)
155155
fmt.Println(err)
156-
// Outputs:
156+
// Output:
157157
// 3
158158
// [<nil>]
159159
// <nil>

until_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func ExampleUntil() {
123123
fmt.Println(i)
124124
fmt.Println(out)
125125
fmt.Println(err)
126-
// Outputs:
126+
// Output:
127127
// 3
128128
// [3]
129129
// <nil>

while_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func ExampleWhile() {
112112
fmt.Println(i)
113113
fmt.Println(out)
114114
fmt.Println(err)
115-
// Outputs:
115+
// Output:
116116
// 3
117117
// []
118118
// <nil>

0 commit comments

Comments
 (0)