Skip to content

Unmarshaling a null range should produce an empty range, not infinity #2

@aodin

Description

@aodin

Ranges have two "zero" states

  1. infinity, or everything
  2. empty, or nothing

Infinity is marshaled to JSON as:

{
  "start": null,
  "end": null
}

Empty is marshaled to JSON as:

null

Unmarshal from these JSON examples should produce the respective ranges. It currently does not for unmarshaling a null. A test case already exists: https://github.com/aodin/date/blob/master/range_test.go#L92-L96

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