Skip to content

Goroutine with Golang

Make multithreading program using goroutine

GO
package main

import (
    "fmt"
)

func firstWorker() {
    fmt.Println("run your first worker")
}

func secondWorker() {
    fmt.Println("run your second worker")
}

func main() {
    go firstWorker()
    go secondWorker()
    fmt.Println("main running")
}
Edit on GitHub