From a5dda62cdc30f28fd27f7a7fb2facbd06eb3520f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E6=AC=A7?= Date: Tue, 5 Mar 2019 06:46:18 +0800 Subject: [PATCH] chore: use internal/json (#1791) --- binding/form_mapping.go | 3 ++- internal/json/json.go | 2 ++ internal/json/jsoniter.go | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/binding/form_mapping.go b/binding/form_mapping.go index 91fadcf..87edfbb 100644 --- a/binding/form_mapping.go +++ b/binding/form_mapping.go @@ -5,12 +5,13 @@ package binding import ( - "encoding/json" "errors" "reflect" "strconv" "strings" "time" + + "github.com/gin-gonic/gin/internal/json" ) var errUnknownType = errors.New("Unknown type") diff --git a/internal/json/json.go b/internal/json/json.go index 419d35f..480e8bf 100644 --- a/internal/json/json.go +++ b/internal/json/json.go @@ -11,6 +11,8 @@ import "encoding/json" var ( // Marshal is exported by gin/json package. Marshal = json.Marshal + // Unmarshal is exported by gin/json package. + Unmarshal = json.Unmarshal // MarshalIndent is exported by gin/json package. MarshalIndent = json.MarshalIndent // NewDecoder is exported by gin/json package. diff --git a/internal/json/jsoniter.go b/internal/json/jsoniter.go index 2021c53..fabd7b8 100644 --- a/internal/json/jsoniter.go +++ b/internal/json/jsoniter.go @@ -12,6 +12,8 @@ var ( json = jsoniter.ConfigCompatibleWithStandardLibrary // Marshal is exported by gin/json package. Marshal = json.Marshal + // Unmarshal is exported by gin/json package. + Unmarshal = json.Unmarshal // MarshalIndent is exported by gin/json package. MarshalIndent = json.MarshalIndent // NewDecoder is exported by gin/json package.