Skip to content

Commit c6caba8

Browse files
authored
Fixed GetInt docs
Fixed example and response type for `GetInt`.
1 parent 9addec9 commit c6caba8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jsonparser.Get(data, "company")
5151

5252
// If the key doesn't exist it will throw an error
5353
var size int64
54-
if value, _, err := jsonparser.GetInt(data, "company", "size"); err == nil {
54+
if value, err := jsonparser.GetInt(data, "company", "size"); err == nil {
5555
size = value
5656
}
5757

@@ -145,7 +145,7 @@ func GetBoolean(data []byte, keys ...string) (val bool, err error)
145145

146146
func GetFloat(data []byte, keys ...string) (val float64, err error)
147147

148-
func GetInt(data []byte, keys ...string) (val float64, err error)
148+
func GetInt(data []byte, keys ...string) (val int64, err error)
149149
```
150150
If you know the key type, you can use the helpers above.
151151
If key data type do not match, it will return error.

0 commit comments

Comments
 (0)