title: How to convert []string to []float64 in Golang?
body: <p>I'm new to programming, and trying to write a simple average program in Go.</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "os"
  )
  
  var numbers []float64
  var sum float64 = 0
  
  func main() {
  
      if len(os.Args) &gt; 1 {
  
          numbers = os.Args[1:]
  
      }
  
      fmt.Println("Numbers are: ", numbers)
      for _, value := range numbers {
          sum += value
      }
  
  }
  </code></pre>
  
  <p><a href="http://play.golang.org/p/TWNltPO71N" rel="noreferrer">http://play.golang.org/p/TWNltPO71N</a></p>
  
  <p>when I build the program, I got this error:</p>
  
  <pre><code>prog.go:15: cannot use os.Args[1:] (type []string) as type []float64 in assignment
  [process exited with non-zero status]
  </code></pre>
  
  <p>So how to convert a slice of string to a slice of float numbers? Can I map a convert function to the slice? </p>