Debian Codegraph @

rainbow/rainbow_test.go

raw symbols SCIP
1 package rainbow
2
3 import (
4 "log"
5 "os"
6 "time"
7 )
8
9 func ExampleNew() {
10
11 timeout := time.NewTimer(time.Second * 1)
12 ticker := time.NewTicker(time.Millisecond * 10)
13
14 log.SetOutput(New(os.Stderr, 252, 255, 43))
15
16 for t := range ticker.C {
17
18 log.Printf("it's %v", t)
19 select {
20 case <-timeout.C:
21 log.Print("stopping!")
22 return
23 default:
24 }
25 }
26
27 // Output:
28 //
29 }