Skip to content

Instantly share code, notes, and snippets.

@dumindu
Created March 29, 2020 10:12
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 dumindu/fd32ee03b71796e43094f545c622b025 to your computer and use it in GitHub Desktop.
Save dumindu/fd32ee03b71796e43094f545c622b025 to your computer and use it in GitHub Desktop.
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