package main import ( "fmt" "time" ) func testRoutine() { fmt.Println("this is one routine!!!") } func main() { //执行协程 go testRoutine() time.Sleep(1) } //协程与线程的关系
Golnag中的并发编程-协程的实现
原文:http://blog.51cto.com/huwho/2307638