title: Golang Reading an Array of Json objects
body: <p>I am using GoLang and want to read the file and be able to send each json object to a REST Endpoint.</p>
  
  <p>the REST endpoint aside, I am having issues parsing the file.</p>
  
  <pre><code>  package main
  
      import (
          "encoding/json"
          "fmt"
          "io/ioutil"
          "bytes"
          "os"
      )
  
      func main() {
          type myjson struct {
              myobjects []struct {
                  data map[string]string
              }
          }
          file, e := ioutil.ReadFile("dat_one_extract.json")
          if e != nil {
              fmt.Printf("File Error: [%v]\n", e)
              os.Exit(1)
          }
  
          dec := json.NewDecoder(bytes.NewReader(file))
          var d myjson
          dec.Decode(&amp;d)
  
  
      }
  </code></pre>
  
  <p>My Json file looks like this:</p>
  
  <pre><code>[{
       "NAME1": "Y",
      "NAME2": 1729.0,
      "NAME3": "Y",
      "NAME4": [
          {
               "Contact Zip": "33619",
              "Date of Contact": "01/21/2015"
          }
      ],
       "NAME6": "123456789",
      "NAME7": "Walmart",
      "NAME8": [
          {
              "State": "xx",
              "Zip Code": "12345",
              "Address": "12345 main street",
              "Type": "MAILING",
              "City": "MyTown"
          },
          {
              "State": "xx",
              "Zip Code": "12345",
              "Address": "12345 main street",
              "Type": "MAILING",
              "City": "MyTown"
          },
          {
              "State": "xx",
              "Zip Code": "12345",
              "Address": "12345 main street",
              "Type": "MAILING",
              "City": "MyTown"
          }
      ],
      "NAME11": "XXXXXXX",
      "NAME12": "11/21/2014 14:01:47",
      "NAME13": "11/15/2014",
      "NAME14": "11/16/1992"
  },{
      "NAME1": "Y",
      "NAME2": 1729.0,
      "NAME3": "Y",
      "NAME4": [
          {
               "Contact Zip": "33619",
              "Date of Contact": "01/21/2015"
          }
      ],
       "NAME6": "123456789",
      "NAME7": "Walmart",
      "NAME8": [
          {
              "State": "xx",
              "Zip Code": "12345",
              "Address": "12345 main street",
              "Type": "MAILING",
              "City": "MyTown"
          },
          {
              "State": "xx",
              "Zip Code": "12345",
              "Address": "12345 main street",
              "Type": "MAILING",
              "City": "MyTown"
          },
          {
              "State": "xx",
              "Zip Code": "12345",
              "Address": "12345 main street",
              "Type": "MAILING",
              "City": "MyTown"
          }
      ],
      "NAME11": "XXXXXXX",
      "NAME12": "11/21/2014 14:01:47",
      "NAME13": "11/15/2014",
      "NAME14": "11/16/1992"
  }]
  </code></pre>
  
  <p>What am I missing to access each array element and pass it to the end point?
  I don't want to process the elements, just send the json object to the endpoint 1 at time.</p>
  
  <p>Thank you in advance and apologies for being a golang noob!</p>