Groups
Sign in
Groups
golang-nuts
Conversations
About
Send feedback
Help
Valid keys for json.Mashall
49 views
Skip to first unread message
aschobel
unread,
Jan 15, 2012, 11:49:38 PM
1/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Howdy,
I ran into a bit of a curiosity with the encoding/json package.
encoding/json.Mashall doesn't encode a field if the tag has a '/' in
it
type SubscriptiontrackHandlerSettings struct {
Enable int `json:"enable"`
TextHtml string `json:"text/html"`
TextPlain string `json:"text/plain"`
}
http://weekly.golang.org/src/pkg/encoding/json/encode.go?s=3491:3534#L415
A JSON object should be able to have a key with a '/' in if you look
at
http://www.json.org/
Should I submit a patch?
Cheers,
Andreas
The API in question is SendGrid's:
http://docs.sendgrid.com/documentation/api/smtp-api/developers-guide/
Brad Fitzpatrick
unread,
Jan 16, 2012, 12:16:29 PM
1/16/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to aschobel, golang-nuts
Good find.
File a bug first, with everything in this email.
Then if you'd like, file a fix following
http://golang.org/doc/contribute.html
, or we can fix it too.
Reply all
Reply to author
Forward
0 new messages