Add goroutines and function pointers

This commit is contained in:
Ayke van Laethem
2018-06-07 14:48:24 +02:00
parent 8df220a53b
commit 0168bf7797
10 changed files with 796 additions and 59 deletions
+10
View File
@@ -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 {