title: How to initialise nested structs in go?
body: <p>Hi I am very new to Golang, please help me. I have defined a struct inside a struct. But I get an error when I try to initialise the main struct. </p>
  
  <pre><code>type DetailsFilter struct {
    Filter struct {
      Name    string        
      ID      int                           
    } 
  }
  
  var M map[string]interface{}
  M = make(map[string]interface{})
  M["Filter"] = map[string]interface{}{"Name": "XYZ", "ID": 5}
  var detailsFilter = DetailsFilter{Filter: M["Filter"]}}
  </code></pre>
  
  <p>The error I get is : can not use (type interface {}) as type struct in field value : need type assertion. </p>
  
  <p>Please suggest a way to initialise DetailsFilter. 
  I tried doing the method described in <a href="https://stackoverflow.com/questions/24809235/initialize-a-nested-struct-in-golang">Initialize a nested struct in Golang</a>, but even this is not working. </p>