title: Golang: goroutine infinite-loop
body: <p>When an <code>fmt.Print()</code> line is removed from the code below, code runs infinitely. Why?</p>
  
  <pre><code>package main
  
  import "fmt"
  import "time"
  import "sync/atomic"
  
  func main() {
          var ops uint64 = 0 
          for i := 0; i &lt; 50; i++ {
                  go func() {
                          for {
                                  atomic.AddUint64(&amp;ops, 1)
                                  fmt.Print()
                          }
                  }()
          }
          time.Sleep(time.Second)
          opsFinal := atomic.LoadUint64(&amp;ops)
          fmt.Println("ops:", opsFinal)
  }
  </code></pre>