-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
13 changed files
with
128 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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package decode | ||
|
||
import ( | ||
"encoding/json" | ||
"github.com/guonaihong/gout/json" | ||
"io" | ||
) | ||
|
||
|
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
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,14 @@ | ||
//go:build go_json | ||
// +build go_json | ||
|
||
package json | ||
|
||
import json "github.com/goccy/go-json" | ||
|
||
var ( | ||
Marshal = json.Marshal | ||
Unmarshal = json.Unmarshal | ||
NewDecoder = json.NewDecoder | ||
NewEncoder = json.NewEncoder | ||
Valid = json.Valid | ||
) |
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 @@ | ||
// 参考 https://github.com/gin-gonic/gin/blob/master/internal/json/jsoniter.go | ||
|
||
//go:build !jsoniter && !go_json && !(sonic && avx && (linux || windows || darwin) && amd64) | ||
// +build !jsoniter | ||
// +build !go_json | ||
// +build !sonic !avx !linux,!windows,!darwin !amd64 | ||
|
||
package json | ||
|
||
import "encoding/json" | ||
|
||
var ( | ||
Marshal = json.Marshal | ||
Unmarshal = json.Unmarshal | ||
NewDecoder = json.NewDecoder | ||
NewEncoder = json.NewEncoder | ||
Valid = json.Valid | ||
) |
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,15 @@ | ||
//go:build jsoniter | ||
// +build jsoniter | ||
|
||
package json | ||
|
||
import jsoniter "github.com/json-iterator/go" | ||
|
||
var ( | ||
json = jsoniter.ConfigCompatibleWithStandardLibrary | ||
Marshal = json.Marshal | ||
Unmarshal = json.Unmarshal | ||
NewDecoder = json.NewDecoder | ||
NewEncoder = json.NewEncoder | ||
Valid = json.Valid | ||
) |
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 @@ | ||
//go:build sonic && avx && (linux || windows || darwin) && amd64 | ||
// +build sonic | ||
// +build avx | ||
// +build linux windows darwin | ||
// +build amd64 | ||
|
||
package json | ||
|
||
import "github.com/bytedance/sonic" | ||
|
||
var ( | ||
json = sonic.ConfigStd | ||
Marshal = json.Marshal | ||
Unmarshal = json.Unmarshal | ||
NewDecoder = json.NewDecoder | ||
NewEncoder = json.NewEncoder | ||
Valid = json.Valid | ||
) |