Can a goroutine go to sleep during a fmt.Println call?

I was doing some debugging and had a bit of code like this:

go func() {         if !finished {                 fmt.Println("Writing the data")                 writer.Write(data)         } }() 

The finished variable is meant as a guard against writing to a writer that has been closed. However, it wasn’t working. It appeared to be getting passed the flag. I determined that the call to Println was yielding the goroutine. Sure enough, removing the call seems to have fixed it. However, I wanted to verify, and more importantly ask for suggestions on how to avoid this properly, rather than just avoiding prints in there.