forked from gin-gonic/gin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(json): make jsonite optional with build tags (gin-gonic#1026)
* refactor(json): Restore gin support for app engine Create new folder to support multiple json package. restore gin support for app engine (disable jsonite through tags) use jsoniter $ go build -tags=jsoniter . use default json $ go build . Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * rename json file. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * docs(json): add build tags document. * fix(docs): markdown format. * fix(json): missing space.
- Loading branch information
1 parent
7180f2b
commit ce670a6
Showing
7 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import ( | |
"errors" | ||
"testing" | ||
|
||
"github.com/gin-gonic/gin/json" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2017 Bo-Yi Wu. All rights reserved. | ||
// Use of this source code is governed by a MIT style | ||
// license that can be found in the LICENSE file. | ||
|
||
// +build !jsoniter | ||
|
||
package json | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
var ( | ||
Marshal = json.Marshal | ||
MarshalIndent = json.MarshalIndent | ||
NewDecoder = json.NewDecoder | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2017 Bo-Yi Wu. All rights reserved. | ||
// Use of this source code is governed by a MIT style | ||
// license that can be found in the LICENSE file. | ||
|
||
// +build jsoniter | ||
|
||
package json | ||
|
||
import ( | ||
"github.com/json-iterator/go" | ||
) | ||
|
||
var ( | ||
json = jsoniter.ConfigCompatibleWithStandardLibrary | ||
Marshal = json.Marshal | ||
MarshalIndent = json.MarshalIndent | ||
NewDecoder = json.NewDecoder | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters