Skip to content

values that cannot be marshaled #4

Open
@ORESoftware

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

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