Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add ScalarMarshaler and ScalarUnmarshaler interfaces #568

Open
x448 opened this issue Jul 28, 2024 · 1 comment
Open

feature: add ScalarMarshaler and ScalarUnmarshaler interfaces #568

x448 opened this issue Jul 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@x448
Copy link
Contributor

x448 commented Jul 28, 2024

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.

@fxamacker fxamacker added the enhancement New feature or request label Aug 3, 2024
@fxamacker
Copy link
Owner

Thanks for opening this issue. I will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants