From 2ad72da7dead0c1f687f628ab499e65c75b88447 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 23 May 2018 19:20:38 +0800 Subject: [PATCH] =?UTF-8?q?gjson=E5=8C=85=E6=96=B0=E5=A2=9EInt8/16/32/64,U?= =?UTF-8?q?int8/16/32/64=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/encoding/gjson/gjson.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/g/encoding/gjson/gjson.go b/g/encoding/gjson/gjson.go index 1ac1a3cc6..b1fecc7c1 100644 --- a/g/encoding/gjson/gjson.go +++ b/g/encoding/gjson/gjson.go @@ -210,10 +210,42 @@ func (j *Json) GetInt(pattern string) int { return gconv.Int(j.Get(pattern)) } +func (j *Json) GetInt8(pattern string) int8 { + return gconv.Int8(j.Get(pattern)) +} + +func (j *Json) GetInt16(pattern string) int16 { + return gconv.Int16(j.Get(pattern)) +} + +func (j *Json) GetInt32(pattern string) int32 { + return gconv.Int32(j.Get(pattern)) +} + +func (j *Json) GetInt64(pattern string) int64 { + return gconv.Int64(j.Get(pattern)) +} + func (j *Json) GetUint(pattern string) uint { return gconv.Uint(j.Get(pattern)) } +func (j *Json) GetUint8(pattern string) uint8 { + return gconv.Uint8(j.Get(pattern)) +} + +func (j *Json) GetUint16(pattern string) uint16 { + return gconv.Uint16(j.Get(pattern)) +} + +func (j *Json) GetUint32(pattern string) uint32 { + return gconv.Uint32(j.Get(pattern)) +} + +func (j *Json) GetUint64(pattern string) uint64 { + return gconv.Uint64(j.Get(pattern)) +} + func (j *Json) GetFloat32(pattern string) float32 { return gconv.Float32(j.Get(pattern)) }