Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created July 20, 2021 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/ea74f49a2442810d6b6a6b7bf3c20b1b to your computer and use it in GitHub Desktop.
Save velotiotech/ea74f49a2442810d6b6a6b7bf3c20b1b to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"sync"
)
var wg sync.WaitGroup
func myFunc(msg string) {
fmt.Println(msg)
}
func main() {
wg.Add(3)
go myFunc("1st call")
go myFunc("2nd call")
go myFunc("3rd call")
wg.Wait()
fmt.Println("Main ended...")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment