Merge pull request #15 from suntoucha/jsonint64_marshal_fix

FIX: JsonInt64.MarshalJSON missing quotes
This commit is contained in:
Aleksandr Zelenin 2019-11-06 20:21:47 +03:00 committed by GitHub
commit faee0d86f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -138,8 +138,8 @@ func buildResponseError(data json.RawMessage) error {
type JsonInt64 int64
// MarshalJSON marshals to json
func (jsonInt64 *JsonInt64) MarshalJSON() ([]byte, error) {
return []byte(strconv.FormatInt(int64(*jsonInt64), 10)), nil
func (jsonInt64 JsonInt64) MarshalJSON() ([]byte, error) {
return []byte(`"`+strconv.FormatInt(int64(jsonInt64), 10)+`"`), nil
}
// UnmarshalJSON unmarshals from json