2023-09-24 18:45:19 +00:00
|
|
|
# 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](https://godoc.org/sourcecode.social/reiver/go-jsonint?status.svg)](https://godoc.org/sourcecode.social/reiver/go-jsonint)
|
2023-09-24 21:29:05 +00:00
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
Here is an example:
|
|
|
|
```go
|
|
|
|
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)
|
|
|
|
```
|
2023-09-26 19:59:58 +00:00
|
|
|
|
|
|
|
## 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:
|
|
|
|
```
|
2023-10-27 18:29:57 +00:00
|
|
|
GOPROXY=direct go get https://sourcecode.social/reiver/go-jsonint
|
2023-09-26 19:59:58 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Author
|
|
|
|
|
|
|
|
Package **jsonint** was written by [Charles Iliya Krempeaux](http://changelog.ca)
|