Created
July 20, 2021 12:59
-
-
Save velotiotech/ea74f49a2442810d6b6a6b7bf3c20b1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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