title: Infinite loop - iteration, the function returns true
body: <p>I've question. I need to make a program running in the background. The program is to collect and save data in my database.</p>
  
  <p>I started to do so:</p>
  
  <pre><code>func main() {
     for {
        doAll()
     }
  }
  </code></pre>
  
  <p>And that retrieves data from all addresses at one time ("go" function):</p>
  
  <pre><code>func doAll() {
     rows, err := MySQL.QueryRow("SELECT * FROM `settings`")
     checkError(err)
     defer rows.Close()
     for rows.Next() {
        c := make(chan bool)
  
        var http string
  
        err = rows.Scan(&amp;http )
        checkError(err)
  
        go doOne(http)
        &lt;- c
     }
  }
  </code></pre>
  
  <p>And that retrieves data from one web site.</p>
  
  <pre><code>func doOne() {
     // some code
     c &lt;- true
  }
  </code></pre>
  
  <p>My question is whether iterations of the "doAll" function will be in order?</p>