I try to loop through a map, that I pass as a pointer to a function, but I can\'t find a way to access the elements. This is the code:
func refreshSession(sessio
You are not taking into account the precedence of *
.
*session[sid]
really means *(session[sid])
, that is, first indexing the pointer to map (hence the error), then dereferencing it.
You should use (*session)[sid].timestamp
to first dereference the pointer to the map and then access it using the key.