README: goroutine

This commit is contained in:
xushiwei
2024-06-01 16:14:26 +08:00
parent 51f3ac2376
commit 881574ed39
2 changed files with 13 additions and 1 deletions

View File

@@ -175,7 +175,6 @@ Common Go syntax is already supported. Except for the following, which needs to
* defer (Not supported yet) * defer (Not supported yet)
* gc (Not supported yet) * gc (Not supported yet)
* chan (Not supported yet) * chan (Not supported yet)
* goroutine (Not supported yet)
* generics (Not supported yet) * generics (Not supported yet)
Here are some examples related to Go syntax: Here are some examples related to Go syntax:
@@ -183,6 +182,7 @@ Here are some examples related to Go syntax:
* [concat](_demo/concat/concat.go): define a variadic function * [concat](_demo/concat/concat.go): define a variadic function
* [genints](_demo/genints/genints.go): various forms of closure usage (including C function, recv.method and anonymous function) * [genints](_demo/genints/genints.go): various forms of closure usage (including C function, recv.method and anonymous function)
* [errors](_demo/errors/errors.go): demo to implement error interface * [errors](_demo/errors/errors.go): demo to implement error interface
* [goroutine](_demo/goroutine/goroutine.go): goroutine demo
## Go packages support ## Go packages support

View File

@@ -0,0 +1,12 @@
package main
func main() {
done := false
go func() {
println("Hello, goroutine")
done = true
}()
for !done {
print(".")
}
}