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
I was expecting some decoding to structs functionality when dealing with dictionaries. am I just missing it?
right now I'm getting errors dbus.Store: type mismatch: map: cannot store a value of map[string]dbus.Variant into Foo
looking at the code looks like it doesn't handle anything but map, slices, interface{}, and primitives.
From the error, it looks like you're not actually receiving a struct, but a map of variants (which is a way to represent "dictionaries" in D-Bus). Structs are something different in the D-Bus model, namely an ordered sequence of typed, but unnamed values. So Go structs are mapped to this and vice versa. You can still use map[string]Variant, but there's no encoding/json-like "magic" for translating this into structs, since it's not that common in D-Bus - usually the schema is known and you can just use structs. Shouldn't be too hard to roll your own reflect-based helper, and I'd also accept a PR for something like this as long as it's only an additional step for converting these dicts to structs.
I was expecting some decoding to structs functionality when dealing with dictionaries. am I just missing it?
right now I'm getting errors
dbus.Store: type mismatch: map: cannot store a value of map[string]dbus.Variant into Foo
looking at the code looks like it doesn't handle anything but map, slices, interface{}, and primitives.
The text was updated successfully, but these errors were encountered: