Skip to content

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

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.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions