Skip to content

feature: add ScalarMarshaler and ScalarUnmarshaler interfaces #568

Open
@x448

Description

@x448

ScalarMarshaler and ScalarUnmarshaler interfaces were added to the encoding package in golang/go:

Description from https://go-review.googlesource.com/c/go/+/553176

encoding/json: handle encoding.ScalarMarshaler and encoding.ScalarUnmarshaler

Per discussion on https://go.dev/issue/56235, Marshal checks for ScalarMarshaler strictly
after TextMarshaler, and Unmarshal delegates to TextUnmarshaler or
ScalarUnmarshaler according to whether the corresponding JSON value is a
string, Boolean, or number. Neither function handles a complex128 type
argument to the interfaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions