This is where Gophers go to land (and take off again)
package main
import (
"fmt"
"sync"
)
func main() {
var wg sync.WaitGroup
greetings := []string{
"Hello, sailor!",
"Привет, моряк!",
"Saluton, maristo!",
"你好,水手!",
"⛵⚓🫡",
}
for _, g := range greetings {
wg.Add(1)
go func(s string) {
defer wg.Done()
fmt.Println(s)
}(g)
}
wg.Wait()
}