Go does not pass references, ever. It either passes values, making copies on assignment, or these values can be pointers, in which case the copy is of a pointer, which is practically a reference.
So let's say we have
type Foo struct {
Bar string
}
if we make a map of values, i.e.
m := map[string]Foo{}
then map accesses return a copy of a Foo, or a zero valued Foo:
m["x"] = Foo{"hello"}
y := m["x"]
y
is now a different object than what's in the map, so changing its Bar
won't affect the object in the map.
But, if we make the map a map of pointers:
m := map[string]*Foo{}
and then access it:
m["x"] = &Foo{"bar"}
y := m["x"]
y is now a pointer to the same object as in the map. We can change its Bar
and it will affect the map:
y.Bar = "wat"
fmt.Println(m["x"].Bar)
// Will print "wat"
Playground example.