From d38431533e517dfa3efc48d219701b25f77289ac Mon Sep 17 00:00:00 2001 From: "Paul Buetow (europa)" Date: Mon, 25 May 2015 01:10:10 +0100 Subject: move --- main/main.go | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 main/main.go (limited to 'main') diff --git a/main/main.go b/main/main.go deleted file mode 100644 index 6cef683..0000000 --- a/main/main.go +++ /dev/null @@ -1,46 +0,0 @@ -package main - -import ( - "fmt" - "github.com/buetow/gstat/process" - "time" -) - -func gather(timer <-chan bool, processes chan<- process.Process) { - for { - switch <-timer { - case false: - { - break - } - case true: - { - process.Gather(processes) - } - } - } - close(processes) -} - -func receive(processes <-chan process.Process) { - for process := range processes { - process.Print() - } -} - -func main() { - timer := make(chan bool) - res := make(chan process.Process) - - go gather(timer, res) - go receive(res) - - for counter := 0; counter < 3; counter++ { - timer <- true - time.Sleep(time.Second) - fmt.Printf("Next... %d\n", counter) - } - timer <- false - - fmt.Println("Good bye") -} -- cgit v1.2.3