go - map of map of structs and "assignment to entry in nil map" -


here's example assignment entry in nil map every time: https://play.golang.org/p/ludjs0rvbs

to demonstrate i'm trying do, here's naive version causes 2 lookups database (you'll have use imagination on line 11): https://play.golang.org/p/yznfemhyms

basically, i'm trying this:

things := make(map[string]map[string][]struct) ... stuff, there := things["first key"] if !there {     things["first key"] = getamapofstringtostructs() } dosomethingwith(things["first key"]) 

i've looked @ more trivial examples of maps-of-maps here can't seem map problem.

you never did make on allentries map:

allentries = make(map[string]map[string][]thing) 

https://play.golang.org/p/ecduu30fqt


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -