Samples
Samples
default-selection
Language: Gold, Platform: Echoes, Category: Tour of Go
https://github.com/remobjects/ElementsSamples/tree/master/Gold/Echoes/Tour of Go/default-selection
-
default-selection.Echoes
-
References
- #
- Source Files
-
Other Files
-
References
default-selection.go
// Ignored build directive: +build OMIT
package main
import (
"fmt"
"time"
)
func main() {
tick := time.Tick(100 * time.Millisecond)
boom := time.After(500 * time.Millisecond)
for {
select {
case <-tick:
fmt.Println("tick.")
case <-boom:
fmt.Println("BOOM!")
return
default:
fmt.Println(" .")
time.Sleep(50 * time.Millisecond)
}
}
}
