From eaaa030a66798b013b02d3e1315ab93e92e37b60 Mon Sep 17 00:00:00 2001 From: TimAndy Date: Tue, 31 Dec 2024 09:57:58 +0800 Subject: [PATCH] refactor(json): export json codec --- binding/form_mapping.go | 2 +- binding/json.go | 2 +- {internal => codec}/json/go_json.go | 0 {internal => codec}/json/json.go | 0 {internal => codec}/json/jsoniter.go | 0 {internal => codec}/json/sonic.go | 0 errors.go | 2 +- errors_test.go | 2 +- render/json.go | 2 +- 9 files changed, 5 insertions(+), 5 deletions(-) rename {internal => codec}/json/go_json.go (100%) rename {internal => codec}/json/json.go (100%) rename {internal => codec}/json/jsoniter.go (100%) rename {internal => codec}/json/sonic.go (100%) diff --git a/binding/form_mapping.go b/binding/form_mapping.go index f5f6f3ae..35c22b17 100644 --- a/binding/form_mapping.go +++ b/binding/form_mapping.go @@ -13,8 +13,8 @@ import ( "strings" "time" + "github.com/gin-gonic/gin/codec/json" "github.com/gin-gonic/gin/internal/bytesconv" - "github.com/gin-gonic/gin/internal/json" ) var ( diff --git a/binding/json.go b/binding/json.go index e21c2ee3..f85fc1a2 100644 --- a/binding/json.go +++ b/binding/json.go @@ -10,7 +10,7 @@ import ( "io" "net/http" - "github.com/gin-gonic/gin/internal/json" + "github.com/gin-gonic/gin/codec/json" ) // EnableDecoderUseNumber is used to call the UseNumber method on the JSON diff --git a/internal/json/go_json.go b/codec/json/go_json.go similarity index 100% rename from internal/json/go_json.go rename to codec/json/go_json.go diff --git a/internal/json/json.go b/codec/json/json.go similarity index 100% rename from internal/json/json.go rename to codec/json/json.go diff --git a/internal/json/jsoniter.go b/codec/json/jsoniter.go similarity index 100% rename from internal/json/jsoniter.go rename to codec/json/jsoniter.go diff --git a/internal/json/sonic.go b/codec/json/sonic.go similarity index 100% rename from internal/json/sonic.go rename to codec/json/sonic.go diff --git a/errors.go b/errors.go index 06b53c28..a6fda985 100644 --- a/errors.go +++ b/errors.go @@ -9,7 +9,7 @@ import ( "reflect" "strings" - "github.com/gin-gonic/gin/internal/json" + "github.com/gin-gonic/gin/codec/json" ) // ErrorType is an unsigned 64-bit error code as defined in the gin spec. diff --git a/errors_test.go b/errors_test.go index 72a36992..334751b8 100644 --- a/errors_test.go +++ b/errors_test.go @@ -9,7 +9,7 @@ import ( "fmt" "testing" - "github.com/gin-gonic/gin/internal/json" + "github.com/gin-gonic/gin/codec/json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/render/json.go b/render/json.go index fc8dea45..f7ada44a 100644 --- a/render/json.go +++ b/render/json.go @@ -10,8 +10,8 @@ import ( "html/template" "net/http" + "github.com/gin-gonic/gin/codec/json" "github.com/gin-gonic/gin/internal/bytesconv" - "github.com/gin-gonic/gin/internal/json" ) // JSON contains the given interface object.