Skip to content

Does not work with dates #3

Description

@palsivertsen

See this playground example.

Docs says:

If omitempty is applied to a struct and all the children of the struct are empty, then on marshalling it will be omitted from the encoded json.

Using omitempty on a time.Time field makes Marshal function always ignore the field.

I suspect this is because time.Time has no exported children and relies on the MarshalJSON function for serialization.

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