On 1/10/23 11:42, Daniel Jankins wrote:
> Hi,
>
> Why can you update a value in a map struct?
>
Sort answer, because m["foo"] is not addressable, but you can have the
desired behavior using a temp variable:
func f() {
m := make(map[string]struct{ i int })
x := m["foo"]
x.i = 42
m["foo"] = x
}
BR.
-- w