title: OK to exit program with active goroutine?
body: <p>Take the following code snippet:</p>
  
  <pre><code>func main() {
      ch := make(chan int)
      quit := make(chan int)
      go func() {
          for {
              ch &lt;- querySomePeriodicThing()
          }
      }()
  
      // ...
  
  loop:
      for {
          select {
          case &lt;-ch: handlePeriodicThing()
          case &lt;-quit: break loop
          }
      }
  }
  </code></pre>
  
  <p>The goroutine should run for the duration of execution. When the select statement receives something from the quit channel, it breaks out of the loop and the program ends, without any attempt to stop the goroutine.</p>
  
  <p>My question: will this have any intermittent adverse effects that are not obvious from running it once or twice? I know that in other languages threads should be cleaned up (i.e., exited) before the program ends, but is go different? Assume that <code>querySomePeriodicThing()</code> does not open file descriptors or sockets or anything that would be bad to leave open.</p>