Skip to content

Instantly share code, notes, and snippets.

@gufranmirza
Created Jul 13, 2019
Embed
What would you like to do?
package main
import (
"fmt"
"time"
)
func printHello() {
fmt.Println("Hello World!")
}
func main() {
fmt.Println("main execution started")
// create goroutine
go printHello()
// schedule another goroutine
time.Sleep(10 * time.Millisecond)
fmt.Println("main execution stopped")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment