From c6caba88342cd0e29e4ea6a4e945863e35bff02e Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Thu, 27 Jul 2017 14:22:49 -0400 Subject: [PATCH] Fixed GetInt docs Fixed example and response type for `GetInt`. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9fa2fdd..8b525f7 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ jsonparser.Get(data, "company") // If the key doesn't exist it will throw an error var size int64 -if value, _, err := jsonparser.GetInt(data, "company", "size"); err == nil { +if value, err := jsonparser.GetInt(data, "company", "size"); err == nil { size = value } @@ -145,7 +145,7 @@ func GetBoolean(data []byte, keys ...string) (val bool, err error) func GetFloat(data []byte, keys ...string) (val float64, err error) -func GetInt(data []byte, keys ...string) (val float64, err error) +func GetInt(data []byte, keys ...string) (val int64, err error) ``` If you know the key type, you can use the helpers above. If key data type do not match, it will return error.