Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bolilla/7c158523096ac27b6359 to your computer and use it in GitHub Desktop.
Save bolilla/7c158523096ac27b6359 to your computer and use it in GitHub Desktop.
GoPadawan Concurrencia Select Timeout After
package main
import "fmt"
import "time"
func main() {
c := make(chan bool)
select {
case d := <-c:
fmt.Println("He leído", d)
case <-time.After(time.Second):
fmt.Println("Me he cansado de esperar")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment