title: Parsing a JSON array of JSON objects?
body: <p>I am trying to get each JSON object out of a JSON array. I get this data via a HTTP post.</p>
  
  <p>I know what my data will look like:</p>
  
  <pre><code>   {
      "array":[
         {
            "entity_title":"University of Phoenix", 
            "entity_org_name":"CS Club",
            "possible_user_name":"Johnny Ive",
            "posibble_user_email":"Johhny.Ive@uop.edu",
            "user_position_title":"President",
            "msg_body_id":4
         },
        {
            "entity_title":"University of San Francisco", 
            "entity_org_name":"Marketing club",
            "possible_user_name":"steve jobs",
            "posibble_user_email":"steven.job@uop.edu",
            "user_position_title":"Student",
            "msg_body_id":5
        }
      ]
    }
  </code></pre>
  
  <p>My example code and my structs look like this:</p>
  
  <pre><code>    type MsgCreateUserArray struct {
           CreateUser []MsgCreateUserJson `json:"createUserArray"`
      }
      type MsgCreateUserJson struct {
          EntityTitleName string  `json:"entity_title_name"`
          EntityOrgName   string  `json:"entity_org_name"`
          PossibleUserName string `json:"possible_user_name"`
          PossibleUserEmail   string  `json:"possible_user_email"`
          UserPositionTitle   string  `json:"user_position_title"`
          MsgBodyId       string  `json:"msg_body_id, omitempty"` 
      }
  
  
  func parseJson(rw http.ResponseWriter, request *http.Request) {
      decodeJson := json.NewDecoder(request.Body)
  
      var msg MsgCreateUserArray
      err := decodeJson.Decode(&amp;msg)
  
      if err != nil {
          panic(err)
      }
      log.Println(msg.CreateUser)
  }
  
  func main() {
      http.HandleFunc("/", parseJson)
      http.ListenAndServe(":1337", nil)
  }
  </code></pre>
  
  <p>I am not sure where how to iterate over the JSON array and get the JSON objects and then just work with the JSON objects.</p>