예제 #1
0
func main() {
	/*ch := make(chan int)
	go Walk(tree.New(1), ch)
	for i:= 0; i < 10; i++ {
		fmt.Print(<-ch, " ")
	}*/
	fmt.Println(Same(tree.New(2), tree.New(2)))
}
예제 #2
0
파일: main.go 프로젝트: uileyar/helloworld
func main() {
	runtime.GOMAXPROCS(2) // 最多使用2个核

	fmt.Println(runtime.NumCPU())
	ch1 := make(chan int)
	ch2 := make(chan int)
	go Walk(tree.New(1), ch1)
	go Walk(tree.New(2), ch2)

	for i := range ch1 {
		fmt.Sprint(i)
	}

	for i := range ch2 {
		fmt.Sprint(i)
	}

	//Same(tree.New(2), tree.New(2))
	//Same(tree.New(2), tree.New(3))
}