Package jsonint provides tools for working with integers in JSON. This helps to work-around that numbers in JSON are effectively "broken".
Go to file
Charles Iliya Krempeaux 3d5abd104c correction 2023-10-27 11:29:57 -07:00
LICENSE initail commits 2023-09-25 03:45:19 +09:00
README.md correction 2023-10-27 11:29:57 -07:00
errors.go jsonint.Int is not longer an optional-type 2023-09-25 06:29:05 +09:00
go.mod initail commits 2023-09-25 03:50:16 +09:00
go.sum initail commits 2023-09-25 03:50:16 +09:00
int.go jsonint.Int is not longer an optional-type 2023-09-25 06:29:05 +09:00
int_marshaljson_test.go jsonint.Int is not longer an optional-type 2023-09-25 06:29:05 +09:00
int_unmarshaljson_test.go jsonint.Int is not longer an optional-type 2023-09-25 06:29:05 +09:00
isnumeric.go initail commits 2023-09-25 03:46:24 +09:00
isnumeric_test.go initail commits 2023-09-25 03:46:24 +09:00
zero_test.go jsonint.Int is not longer an optional-type 2023-09-25 06:29:05 +09:00

README.md

go-jsonint

Package jsonint provides tools for working with integers in JSON.

This helps to work-around that numbers in JSON are effectively "broken".

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/sourcecode.social/reiver/go-jsonint

GoDoc

Example

Here is an example:

type Account struct {
	FollowersCount jsonint.Int `json:"followers_count"`
	FollowingCount jsonint.Int `json:"following_count"`
	StatusexCount  jsonint.Int `json:"statuses_count"`
}

// ...

var account Account

err := json.Unmarshal(data, &account)

Import

To import package jsonint use import code like the follownig:

import "sourcecode.social/reiver/go-jsonint"

Installation

To install package jsonint do the following:

GOPROXY=direct go get https://sourcecode.social/reiver/go-jsonint

Author

Package jsonint was written by Charles Iliya Krempeaux