32
edits
Changes
Team Go
,no edit summary
== Goroutines ==
A goroutine is a function capable of running concurrently with other functions. They're similar to threads except they're much cheaper , light weight and are managed automatically.<source lang="go">package main import ( "fmt" "time") func say(s string) { for i := 0; i < 5; i++ { time.Sleep(100 * time.Millisecond) fmt.Println(s) }} func main() { go say("world") say("hello")} </source>