1/ I wish #golang json serialization marshal/unmarshal an int64 as a string while keeping the int64 representation. Something like,
type User {
UserId int64 `json:"user_id,stringmode"`
}
3/ Whether it's worth the complexity to "encoding/json" is a different matter. My guess is: no. But, I'm not going to try an attempt a patch now because 1) not a priority and 2) no desire to play with #golang reflection code.
-
-
p.s. It sounds like you are just asking for json.Number https://golang.org/pkg/encoding/json/#Number …
-
hrm. isn't that the opposite? I want int64 in my struct with automatic serialization, not string in my struct with gauranteed int64 representation. ...although, i guess that's the obvious solution for me: just write an int64 with MarshalJSON/UnmarshalJSON.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.