Skip to content

values that cannot be marshaled #4

Description

@ORESoftware

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.).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions