Exemple #1
0
func mainFirst() {
	fmt.Println(stringutil.Reverse("!oG ,olleH"))
	go ready("Tea", 2)
	go ready("Coffee", 1)
	fmt.Println("I am waiting")
	time.Sleep(5 * time.Second)

}
Exemple #2
0
func mainSecond() {
	fmt.Println(stringutil.Reverse("!oG ,olleH"))
	c = make(chan int)
	go readyTwo("Tea", 2)
	go readyTwo("Coffee", 1)
	fmt.Println("I am waiting, but not too long")
	//time.Sleep(5 * time.Second)
	<-c
	<-c

}
Exemple #3
0
func secondMain() {
	fmt.Println(stringutil.Reverse("!oG ,olleH"))
	time.Sleep(5 * time.Second)
	OldMain()

}