Yikes, I would not do it that way.

The "nearly always" intentional race condition is scary. When it loses the race, printing unexpected things to stdout will break scripts.

Check if stdin (not stdout or stderr) is a tty. If so, print the prompt to the tty (not stdout or stderr) before reading anything. No goroutines or timeouts. That should work in all cases, even if an interactive user has redirected output to a file.

I'm not generally a fan of changing behavior based on tty-ness, but it's better than this.