Skip to content

Instantly share code, notes, and snippets.

@markchadwick
Created October 4, 2012 14:53
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 markchadwick/3834053 to your computer and use it in GitHub Desktop.
Save markchadwick/3834053 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
func main() {
c := make(chan int)
close(c)
select {
default:
fmt.Println("Selected nothing")
case value := <-c:
fmt.Printf("Selected: %#v\n", value)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment