Why does fmt.Println inside a goroutine not print a line?

Your program will exit when the main() function finishes. This is likely to happen before your goroutine has time to run and print its output.

One option would be to have the main goroutine block reading from a channel, and have the goroutine write to the channel when it has completed its work.

Leave a Comment