Skip to content

Instantly share code, notes, and snippets.

@tenntenn
Created December 26, 2012 10:03
Show Gist options
  • Save tenntenn/4379340 to your computer and use it in GitHub Desktop.
Save tenntenn/4379340 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
)
func main() {
select {
case m := <-c:
handle(m)
case <-time.After(5 * time.Minute):
fmt.Println("timed out")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment