-
Notifications
You must be signed in to change notification settings - Fork 10
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
types: clean up JSON unmarshaling story for extension types #64
Conversation
var zeroT T | ||
var arg string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you could combine this into one var declaration
var zeroT T | |
var arg string | |
var ( | |
zeroT T | |
arg string | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I prefer the two line version...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…rshalers Signed-off-by: Patrick Jakubowski <[email protected]>
…r all extension types Signed-off-by: Patrick Jakubowski <[email protected]>
Signed-off-by: Patrick Jakubowski <[email protected]>
Signed-off-by: Patrick Jakubowski <[email protected]>
Signed-off-by: Patrick Jakubowski <[email protected]>
Signed-off-by: Patrick Jakubowski <[email protected]>
Signed-off-by: Patrick Jakubowski <[email protected]>
a1f1f5f
to
3b282ac
Compare
Issue #, if available: None
Description of changes:
Create a generic
unmarshalExtensionValue()
helper function that supports all three forms of extension value JSON encoding:{ "__extn": { "fn": "decimal", "arg": "1234.5678" } }
{ "fn": "decimal", "arg": "1234.5678" } }
"1234.5678"
Use it to flesh out the implementations of
UnmarshalJSON
forIPAddr
andDecimal
. Note that the implicit decoding will never actually be invoked until we have schema-driven decoding for entities.