Skip to content

Option to encode nil slice/map as []/{} #25

@Stebalien

Description

@Stebalien

Given that:

  1. Empty slices/maps are often represented as nil in go (i.e., go doesn't really care).
  2. Most other languages distinguish between null and an empty list/object.

It would be nice to have an option to always encode empty slices/maps as []/{}.

Unfortunately, doing this with an atlas doesn't appear to be possible as maps/slices are generic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions