Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(453)

Unified Diff: src/pkg/time/tick_test.go

Issue 4079053: code review 4079053: replace non-blocking send, receive syntax with select (Closed)
Patch Set: code review 4079053: replace non-blocking send, receive syntax with select Created 14 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/time/tick.go ('k') | test/chan/nonblock.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/time/tick_test.go
===================================================================
--- a/src/pkg/time/tick_test.go
+++ b/src/pkg/time/tick_test.go
@@ -29,9 +29,11 @@
}
// Now test that the ticker stopped
Sleep(2 * Delta)
- _, received := <-ticker.C
- if received {
+ select {
+ case <-ticker.C:
t.Fatal("Ticker did not shut down")
+ default:
+ // ok
}
}
« no previous file with comments | « src/pkg/time/tick.go ('k') | test/chan/nonblock.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b