mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 04:53:42 +00:00
Add goroutines and function pointers
This commit is contained in:
@@ -25,6 +25,16 @@ func main() {
|
||||
printItf(5)
|
||||
printItf(byte('x'))
|
||||
printItf("foo")
|
||||
|
||||
runFunc(hello) // must be indirect to avoid obvious inlining
|
||||
}
|
||||
|
||||
func runFunc(f func()) {
|
||||
f()
|
||||
}
|
||||
|
||||
func hello() {
|
||||
println("hello from function pointer!")
|
||||
}
|
||||
|
||||
func strlen(s string) int {
|
||||
|
||||
Reference in New Issue
Block a user