Asynchronous Functions

A function can be executed asynchronously when it is preceded by the statement go, which indicates that a function is executed as a goroutine.

The main() function runs as a goroutine by default, so every program has at least one goroutine running.

Goroutines will be featured in future threads.


// Run the function in a separate goroutine
go MyFunction(param)
                        
async_functions.go