Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't marshal a Variant value as JSON #306

Open
lifubang opened this issue Feb 5, 2022 · 0 comments · May be fixed by #307
Open

Can't marshal a Variant value as JSON #306

lifubang opened this issue Feb 5, 2022 · 0 comments · May be fixed by #307

Comments

@lifubang
Copy link

lifubang commented Feb 5, 2022

As described by @kolyshkin in opencontainers/runc#3361 (comment), we can't marshal a Variant variable as a json string.

If we use json.Marshal, we will get an empty string(Not an empty string, but an empty JSON like "{}").
If we use Encode in encoding/gob, we will get an error:

Error encoding: gob: type dbus.Variant has no exported fields

Do you want to implement the json interface? Or let others who use the type Variant to implement it in their own projects?

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 a pull request may close this issue.

1 participant