Created
March 29, 2020 10:12
-
-
Save dumindu/fd32ee03b71796e43094f545c622b025 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" | |
) | |
func main() { | |
wg := sync.WaitGroup{} | |
wg.Add(1) | |
greet := "Hello world!" | |
go func(s string) { | |
fmt.Println(s) | |
wg.Done() | |
}(greet) | |
greet = "こんにちは世界!" | |
wg.Wait() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment