You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently funk.Get allows to address map key provided it's a simple name i.e. the key without dots (and other non-word characters).
I'd like to propose that the support for more complex keys is added to the library. This is quite common use occurrence in annotation maps etc. Effectively ability to specify the key as quoted string e.g. some.path."my.special.key".
m:=map[string]interface{}{
"basic": map[string]interface{}{
"hello": "world",
},
"complex": map[string]interface{}{
"example.com/foo": "bar",
},
}
fmt.Println(funk.Get(m, "basic.hello")) // returns "world" <- this currently works as expectedfmt.Println(funk.Get(m, `complex."example.com/foo"`)) // expected to return "bar"
Am happy to submit PR for it as well.
The text was updated successfully, but these errors were encountered:
Currently
funk.Get
allows to address map key provided it's a simple name i.e. the key without dots (and other non-word characters).I'd like to propose that the support for more complex keys is added to the library. This is quite common use occurrence in annotation maps etc. Effectively ability to specify the key as quoted string e.g.
some.path."my.special.key"
.Am happy to submit PR for it as well.
The text was updated successfully, but these errors were encountered: