协程(goroutine)
什么是goroutine(协程)
goroutine vs 线程
开启一个goroutine
goroutinepackage main
import "fmt"
func hello() {
fmt.Println("Hello world goroutine")
}
func main() {
go hello()
fmt.Println("main function")
}开启多个goroutine
goroutine
Last updated
Was this helpful?