title: Go: append directly to slice found in a map
body: <p>I wanted to create a map of slices where values are appended to the corresponding slice. However, when trying to append directly to the slice returned by accessing it (see comment below), it would not be stored, so I had to go with the long form access (line below the comment).</p>
  
  <p>Why is it so? I expected the access to the map to return some sort of pointer, so in my mind <code>mappedAminoAcid == aminoAcidsToCodons[aminoAcid]</code>; clearly, I'm wrong.</p>
  
  <p>Thanks!</p>
  
  <pre><code>aminoAcidsToCodons := map[rune][]string{}
  for codon, aminoAcid := range utils.CodonsToAminoAcid {
      mappedAminoAcid, ok := aminoAcidsToCodons[aminoAcid]
  
      if ok {
          // NOT WORKING: mappedAminoAcid = append(mappedAminoAcid, codon)
          aminoAcidsToCodons[aminoAcid] = append(mappedAminoAcid, codon)
      } else {
          aminoAcidsToCodons[aminoAcid] = []string{codon}
      }
  }
  </code></pre>