goroutine

A goroutine is a piece of code scheduled by Go, not the OS. Code in a goroutine can run concurrently with other code. Goroutine runs in a M:N threading model, that is, we have M goroutines running on N OS threads.The Go runtime multiplexes a potentially large number of goroutines onto a smaller number of OS threads, and goroutines blocked on I/O are handled efficiently using epoll or similar facilities. Goroutines have tiny stacks that grow as needed, so it is practical to have hundreds of thousands of goroutines in your program. This allows the programmer to use concurrency to structure their program without being overly concerned with thread overhead.
To start a goroutine, we use the <b>go</b> keyword followed by the function we want to execute. 
```
package main
import (
    "fmt"
    "time"
)

func main (){
    go process ()
    time.Sleep(2 * time.Second); // let goroutine has time to print
}

func process () {
    fmt.Println ("processing")
}
```
Anonymous function can also be used with goroutine.
```
go func() {
	fmt.Println("processing")
}()
```