On May 12, 3:53 pm, Daniel Smith <
dan...@lukenine45.net> wrote:
> You can get a pointer to the value with &mymap[key].
This is not accurate. Per the spec:
"The address-of operator & generates the address of its operand, which
must be addressable, that is, either a variable, pointer indirection,
array or slice indexing operation, or a field selector of an
addressable struct operand."
Allowing address-of on map entry values poses a problem for deleted
entries. Either it allows unsafe access to potentially freed memory
or it requires that the map implementation use distinct, GC-able map
entry objects.