-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sonic json support (#3184)
* feat: add sonic json support * fix: add blank line in readme
- Loading branch information
Showing
7 changed files
with
67 additions
and
4 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
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,27 @@ | ||
// Copyright 2022 Gin Core Team. All rights reserved. | ||
// Use of this source code is governed by a MIT style | ||
// license that can be found in the LICENSE file. | ||
|
||
//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 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. | ||
NewDecoder = json.NewDecoder | ||
// NewEncoder is exported by gin/json package. | ||
NewEncoder = json.NewEncoder | ||
) |