title: How to convert entire nested struct into map
body: <p>I have a scenario where I have to convert the entire struct into a map.
  I know we have a library structs.Map(s) which will convert the struct to a map. But I want to know is there a way where i can convert multiple struct inside struct to map[string]interface.
  for example we have below</p>
  <pre><code>package main
  
  import (
      &quot;log&quot;
  
      &quot;github.com/fatih/structs&quot;
  )
  
  type Community struct {
      Name        string   `json:&quot;name,omitempty&quot;`
      Description string   `json:&quot;description,omitempty&quot;`
      Sources     []Source `json:&quot;sources,omitempty&quot;`
      Moderators  []string `json:&quot;moderators,omitempty&quot;`
  }
  
  type Source struct {
      SourceName string  `json:&quot;sourceName,omitempty&quot;`
      Region []State `json:&quot;region,omitempty&quot;`
  }
  
  type State struct {
      State1 string `json:&quot;state1,omitempty&quot;`
      State2 string `json:&quot;state2,omitempty&quot;`
  }
  
  func main() {
  
      compareData := Community{
          Name:        &quot;A&quot;,
          Description: &quot;this belong to A community&quot;,
          Sources: []Source{
              {
                  SourceName: &quot;SourceA&quot;,
                  Region: []State{
                      {
                          State1: &quot;State1&quot;,
                      },
                      {
                          State2: &quot;State2&quot;,
                      },
                  },
              },
          },
      }
      m := structs.Map(compareData)
      log.Println(m)
  }
  </code></pre>
  <p>this will give result as below ,that is it is creating map for the inside struct again</p>
  <pre><code>map[Description:this belong to A community 
  Moderators:[] 
  Name:A Sources:[map[SourceName:SourceA Region:[map[State1:State1 State2:] map[State1: State2:State2]]]]]
  </code></pre>
  <p>my expectation is get only a single map[string]interface{}</p>
  <pre><code>map[
  Description:this belong to A community 
  Moderators:[] 
  Name:A 
  SourceName:SourceA 
  State1:State1 
  State2:State2
  ]
  </code></pre>
  <p>my purpose of creating a single map is to compare the value to a different map based on key .
  My struct  also varies as per the different response so i want to have a map where i can get all the key value pairs for easy comparison . If someone has a suggestion to this please let me know .</p>