Re: [go-nuts] Given a `[]string` key list and a `map[string]interface{}`, can we find the value?

2017-02-12 Thread John Feminella
Agreed on the panic, and yours handles that better. (Although I hope it's obvious that this was just a toy example and not the real thing!) best,~ jf--John Feminella@jxxfhttp://jxf.me On Sun, Feb 12, 2017 3:23 PM, Paul Borman bor...@google.com wrote: Your code can panic. Take a lo

Re: [go-nuts] Given a `[]string` key list and a `map[string]interface{}`, can we find the value?

2017-02-12 Thread John Feminella
Thanks. I wound up doing this with a recursive traversal: https://play.golang.org/p/k9iy3sHOZ9 best,~ jf--John Feminella@jxxfhttp://jxf.me On Sun, Feb 12, 2017 3:05 PM, Paul Borman bor...@google.com wrote: Take a look at the reflect package, or if you know that the only internal maps will