title: How to get the nested struct from variable from a string representation?
body: <p>I have a JSON file looks like following somehow</p>
  
  <pre><code>{
      "type": "Weekly",
      "clients": [
          "gozo",
          "dva"
      ],
      "sender": "no-reply@flowace.in",
      "recipients": {
          "gozo": [
              "a@gmail.com",
              "b@hotmail.com"
          ],
          "dva": [
              "c@gmail.com",
              "d@hotmail.com"
          ]
      },
      "features": [
          "Top5UsedApps",
          "TimeSpentOnEachL3",
          "NewlyAssignedL3",
          "HoursLogged"
      ],
      "dbCloning": [
          "dva"
      ] 
  }
  </code></pre>
  
  <p>I have mapped structs like the following.</p>
  
  <pre><code>type receivers struct {
      Gozo []string `json:"gozo"`
      Dva  []string `json:"dva"`
      // Add more recievers
  }
  
  // Config -- The config object parsed from the JSON file
  type Config struct {
      ReportType string    `json:"type"`
      Clients    []string  `json:"clients"`
      Sender     string    `json:"sender"`
      Recipients receivers `json:"recipients"`
      Cloning    []string  `json:"dbCloning"`
  }
  </code></pre>
  
  <p>Then somewhere in the another source file, I do the following,</p>
  
  <pre><code>func main() {
      conf := LoadConfig(os.Args[1])
      for _, client := range conf.Clients {
  
          // Use the client variable of some other function calls
  
          fmt.Println(conf.Recipients[client]) // This will not work
  }
  </code></pre>
  
  <p>Now my question is how can I make it work. I can not loop over <code>conf.Recipients</code> directly. </p>
  
  <p>PS: Consider that <code>LoadConfig</code> function unmarshal the JSON and returns a <code>conf</code> object.</p>
  
  <p><strong>Edit 1:</strong> It looks like it was design decision error. Now going with the solution of <code>map[string][]string</code>. But not marking it as an answer because the need to know how it is easily done for all the cases where there was no other choices.</p>