title: Appending maps to a map in Go
body: <p>I am trying to build a map[string]map[string]string which will look something like this:</p>
  
  <pre><code>{ "notes": 
      {
      "Title":note.Title,
      "Body":note.Body,
      },
      {
      "Title":note.Title,
      "Body":note.Body,
      },
      {
      "Title":note.Title,
      "Body":note.Body,
      },
  }
  </code></pre>
  
  <p>from a struct (notes) of structs (note)</p>
  
  <p>I have thought of doing it like this:</p>
  
  <pre><code>for _, note := range notes {
          thisNote := map[string]string{
              "Title":note.Title,
              "Body":note.Body,
          }
  
          content["notes"] = append(content["notes"], thisNote)
  }
  </code></pre>
  
  <p>But obviously that is not going to work because I am trying to append a map to a map rather than a slice.</p>
  
  <p>Is there a really easy solution to this that I am missing?</p>