协程_Go语言协程实现

原理

1
2
3
4
5
6
7
8
9
func main()
{
go sayHello()
// continue doing other things
}
func sayHello()
{
fmt.Println("hello")
}