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

values that cannot be marshaled #4

Open
ORESoftware opened this issue Feb 14, 2020 · 0 comments
Open

values that cannot be marshaled #4

ORESoftware opened this issue Feb 14, 2020 · 0 comments

Comments

@ORESoftware
Copy link
Owner

https://stackoverflow.com/a/60203562/12849275

From json.Marshal():

Channel, complex, and function values cannot be encoded in JSON. Attempting to encode such a value causes Marshal to return an UnsupportedTypeError.

JSON cannot represent cyclic data structures and Marshal does not handle them. Passing cyclic structures to Marshal will result in an infinite recursion.

Going further, not mentioned in the doc, but unsafe.Pointer also cannot be marshaled.

Same goes for any composite type containing an unsupported type (e.g. slice of channels, struct holding an unsafe.Pointer exported field etc.).
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

No branches or pull requests

1 participant