_testgo: goroutine

This commit is contained in:
xushiwei
2024-06-01 16:04:35 +08:00
parent e5802853c0
commit 51f3ac2376
5 changed files with 40 additions and 37 deletions

View File

@@ -2,10 +2,10 @@ package main
func main() {
done := false
go func() {
println("Hello, World!")
go func(s string) {
println(s)
done = true
}()
}("Hello, goroutine")
for !done {
print(".")
}