Skip to content

Conversation

@lifubang
Copy link

@lifubang lifubang commented Feb 5, 2022

close #306

After this patch, we can use json.Marshal, json.UnMarshal, GobEncode, and GobDecode for a Variant variable.

@guelfey
Copy link
Member

guelfey commented Feb 5, 2022

I'm not 100% convinced of this for multiple reasons:

  1. Variant is only really meant for communication over dbus. Directly storing it or persisting it doesn't seem like a good idea to me; you can still handle that case if really needed using conversions in application code.
  2. It shouldn't be necessary to use maps for representation - String() already returns a string that can be unambiguously parsed back to the same value (which it does by explicitly including the signature if needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't marshal a Variant value as JSON

2 participants