I'm using Gorilla mux for my handlers and using mux.Vars. I'm trying to write a test for one of the handlers that uses mux.Vars so what I do is
var vars = map[string]string{
"id": user.ID,
}
context.Set(req, 0, vars)
In mux the key (an integer) is undefined so by default 0. I've logged the key when mux.Vars gets called and it prints 0. I should be able to key into this map
map[0:map[id:522d14f5b1b92235d6000002]]
by doing map[key] but that returns nil. However, I get the correct value back if I hardcode map[0]. Any thoughts?