title: Go, Golang : traverse through struct
body: <p><a href="http://play.golang.org/p/fJACxhSrXX" rel="noreferrer">http://play.golang.org/p/fJACxhSrXX</a></p>
  
  <p>I want to traverse through an array of structs.</p>
  
  <pre><code> func GetTotalWeight(data_arr []struct) int {
      total := 0
      for _, elem := range data_arr {
          total += elem.weight
      }
      return total
   }
  </code></pre>
  
  <p>But I am getting syntax error</p>
  
  <pre><code>   syntax error: unexpected ), expecting {
  </code></pre>
  
  <p>Is it possible to traverse through structs?</p>