title: How should I write goroutine?
body: <p>Now I have the following code:</p>
  
  <pre><code>package main
  
  import (
      "crypto/md5"
      "encoding/hex"
      "fmt"
      "io"
      "math"
      "strconv"
  )
  
  func Md5Str(str string) string {
      m := md5.New()
      io.WriteString(m, str)
      return hex.EncodeToString(m.Sum(nil))
  }
  
  func compute(size int) int {
      num := int(math.Floor(float64(size+256*1024-1)) / 256 / 1024)
      return num
  }
  
  func out(s string) string {
      return "Hello: " + s
  }
  
  func main() {
      num := compute(4194304)
      for i := 0; i &lt; num; i++ {
          key := Md5Str("503969280ff8679135937ad7d23b06c5" + "_" + strconv.Itoa(i))
          res := out(key + "_" + strconv.Itoa(i))
          fmt.Println(res)
      }
  }
  </code></pre>
  
  <p>And it can run right.</p>
  
  <p>I want to concurrency run the code, because if the <code>out</code> function run long time and the concurrency run will save time.</p>