File: rainbow_test.go

package info (click to toggle)
golang-github-aybabtme-rgbterm 0.0~git20170906.cc83f3b-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 124 kB
  • sloc: makefile: 2
file content (29 lines) | stat: -rw-r--r-- 369 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package rainbow

import (
	"log"
	"os"
	"time"
)

func ExampleNew() {

	timeout := time.NewTimer(time.Second * 1)
	ticker := time.NewTicker(time.Millisecond * 10)

	log.SetOutput(New(os.Stderr, 252, 255, 43))

	for t := range ticker.C {

		log.Printf("it's %v", t)
		select {
		case <-timeout.C:
			log.Print("stopping!")
			return
		default:
		}
	}

	// Output:
	//
}