title: Cannot assign struct field in nested map Golang
body: <p>I have the next structure:</p>
  
  <pre><code>type filesDB struct {
      Name    string
      Content []byte
  }
  
  type fileDB struct {
    Files map[string]filesDB
  }
  </code></pre>
  
  <p>Well, when I try to save data in JSON format with the maps, I try this:</p>
  
  <p>First, I make a map var:</p>
  
  <pre><code>var filesDatabase = map[string]fileDB{}
  </code></pre>
  
  <p>Then, i try to insert data:</p>
  
  <pre><code>    var f filesDB
      fidb := map[string]filesDB{}
      f.Name= filename
      f.Content= encrypt(b, sUser[user].Cipher)
      fidb[filename] = f
      filesDatabase[user].Files = fidb
      jsonDB, err := json.Marshal(filesDatabase)
  </code></pre>
  
  <p>So, when I try to run the script, I get the next error:</p>
  
  <blockquote>
    <p>cannot assign to struct field filesDatabase[user].Files in map</p>
  </blockquote>
  
  <p>How can I resolve this error? Thanks!</p>