Skip to content

Allow inline tag on custom map key types that implement encoding.Text*arshaler #50

Closed
@edkloczko

Description

@edkloczko

In both the standard and experimental json libraries, I can use a custom type that implements the encoding.TextUnmarshaler and encoding.TextMarshaler interfaces as map keys. When using the inline flag, this is no longer allowed.

I think I understand why the original proposal stated:

The inlined field must be a Go struct that does not implement Marshaler or Unmarshaler

But I'm having a hard time understanding why the string-ish behavior for map keys couldn't be applied to inline tagged maps as well.

Thank you!

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