add internal package which includes json package (#1504)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by 田欧 · committed by GitHub · parent 708b76a · Browse files · 9 files·+38 added−38 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+38 added−38 removed
- other:+38 added−38 removed
Provenance
- Commit
72db8ac- Tree
0ac05b8- Author
田欧 <thinkerou@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
708b76a
9 files changed+38 added−38 removed
modified:binding/json.go+1 added-1 removed
7 unmodified lines8 "bytes"9 "io"10 "net/http"11 12- "github.com/gin-gonic/gin/json"12+ "github.com/gin-gonic/gin/internal/json"13 )14 15 // EnableDecoderUseNumber is used to call the UseNumber method on the JSON16 // Decoder instance. UseNumber causes the Decoder to unmarshal a number into an27 unmodified linesadded:internal/json/json.go+16 added
1+// Copyright 2017 Bo-Yi Wu. All rights reserved.2+// Use of this source code is governed by a MIT style3+// license that can be found in the LICENSE file.4+5+// +build !jsoniter6+7+package json8+9+import "encoding/json"10+11+var (12+ Marshal = json.Marshal13+ MarshalIndent = json.MarshalIndent14+ NewDecoder = json.NewDecoder15+ NewEncoder = json.NewEncoder16+)added:internal/json/jsoniter.go+17 added
1+// Copyright 2017 Bo-Yi Wu. All rights reserved.2+// Use of this source code is governed by a MIT style3+// license that can be found in the LICENSE file.4+5+// +build jsoniter6+7+package json8+9+import "github.com/json-iterator/go"10+11+var (12+ json = jsoniter.ConfigCompatibleWithStandardLibrary13+ Marshal = json.Marshal14+ MarshalIndent = json.MarshalIndent15+ NewDecoder = json.NewDecoder16+ NewEncoder = json.NewEncoder17+)deleted:json/json.go-16 removed
1-// Copyright 2017 Bo-Yi Wu. All rights reserved.2-// Use of this source code is governed by a MIT style3-// license that can be found in the LICENSE file.4-5-// +build !jsoniter6-7-package json8-9-import "encoding/json"10-11-var (12- Marshal = json.Marshal13- MarshalIndent = json.MarshalIndent14- NewDecoder = json.NewDecoder15- NewEncoder = json.NewEncoder16-)deleted:json/jsoniter.go-17 removed
1-// Copyright 2017 Bo-Yi Wu. All rights reserved.2-// Use of this source code is governed by a MIT style3-// license that can be found in the LICENSE file.4-5-// +build jsoniter6-7-package json8-9-import "github.com/json-iterator/go"10-11-var (12- json = jsoniter.ConfigCompatibleWithStandardLibrary13- Marshal = json.Marshal14- MarshalIndent = json.MarshalIndent15- NewDecoder = json.NewDecoder16- NewEncoder = json.NewEncoder17-)modified:render/json_17.go+1 added-1 removed
7 unmodified lines8 9 import (10 "net/http"11 12- "github.com/gin-gonic/gin/json"12+ "github.com/gin-gonic/gin/internal/json"13 )14 15 type PureJSON struct {16 Data interface{}12 unmodified linesmodified:render/json.go+1 added-1 removed
8 unmodified lines9 "fmt"10 "html/template"11 "net/http"12 13- "github.com/gin-gonic/gin/json"13+ "github.com/gin-gonic/gin/internal/json"14 )15 16 type JSON struct {17 Data interface{}127 unmodified linesmodified:errors_test.go+1 added-1 removed
6 unmodified lines7 import (8 "errors"9 "testing"10 11- "github.com/gin-gonic/gin/json"11+ "github.com/gin-gonic/gin/internal/json"12 "github.com/stretchr/testify/assert"13 )14 15 func TestError(t *testing.T) {91 unmodified linesmodified:errors.go+1 added-1 removed
7 unmodified lines8 "bytes"9 "fmt"10 "reflect"11 12- "github.com/gin-gonic/gin/json"12+ "github.com/gin-gonic/gin/internal/json"13 )14 15 type ErrorType uint6416 141 unmodified lines