Skip to content

Instantly share code, notes, and snippets.

@mrnugget
Created June 5, 2014 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrnugget/a0137670f3b38931674b to your computer and use it in GitHub Desktop.
Save mrnugget/a0137670f3b38931674b to your computer and use it in GitHub Desktop.
golang time.After
package main
import (
"time"
)
func main() {
ticker := time.Tick(100 * time.Millisecond)
for {
select {
case <-ticker:
println(".")
case <-time.After(1 * time.Second): // BUG
println("after called")
return
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment