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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -