Have loook at this contrived example:
package main
import \"fmt\"
func printElo() {
fmt.Printf(\"Elo\\n\")
}
func printHello() {
fmt.Printf(\"Hel
As already mentioned sync.WaitGroup is a right way in production code. But when developing for test and debug purposes you can just add select{} statement at the end or the main().
func main(){
go routine()
...
select{}
}
main() then never returns and you would kill it with for example Ctrl-C. It isn't idiomatic, never used in production, but just very quick easy hack when developing.