title: Runtime error: "assignment to entry in nil map"
body: <p>I'm trying to create a slice of Maps. Although the code compiles fine, I get the runtime error below:</p>
  
  <pre><code>mapassign1: runtime·panicstring("assignment to entry in nil map");
  </code></pre>
  
  <p>I attempt to make an array of Maps, with each Map containing two indicies, a "Id" and a "Investor".  My code looks like this:</p>
  
  <pre><code>for _, row := range rows {
          var inv_ids []string
          var inv_names []string
  
          //create arrays of data from MySQLs GROUP_CONCAT function
          inv_ids = strings.Split(row.Str(10), ",")
          inv_names = strings.Split(row.Str(11), ",")
          length := len(inv_ids);
  
          invs := make([]map[string]string, length)
  
          //build map of ids =&gt; names
          for i := 0; i &lt; length; i++ {
              invs[i] = make(map[string]string)
              invs[i]["Id"] = inv_ids[i]
              invs[i]["Investor"] = inv_names[i]
          }//for
  
          //build Message and return
          msg := InfoMessage{row.Int(0), row.Int(1), row.Str(2), row.Int(3), row.Str(4), row.Float(5), row.Float(6), row.Str(7), row.Str(8), row.Int(9), invs}
          return(msg)
      } //for
  </code></pre>
  
  <p>I initially thought something like below would work, however that did not fix the issue either.  Any ideas?</p>
  
  <pre><code>invs := make([]make(map[string]string), length)
  </code></pre>