Create goroutines
suggest changeAny function can be invoked as a goroutine by prefixing its invocation with the keyword go:
func mult(x, y int) {
fmt.Printf("%d * %d = %d\n", x, y, x*y)
}
go mult(1, 2) // first execution, non-blocking
go mult(3, 4) // second execution, also non-blocking
1 * 2 = 2
3 * 4 = 12
A go statement does not use the function's results. mult returns nothing; if it returned a value, that value would be discarded.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents