File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1717package utils
1818
1919import (
20- "github.com/bytedance/sonic "
20+ "encoding/json "
2121)
2222
2323func MarshalJSONIndent (input any ) (string , error ) {
24- js , err := sonic .MarshalIndent (input , "" , " " )
24+ js , err := json .MarshalIndent (input , "" , " " )
2525 if err != nil {
2626 return "" , err
2727 }
2828 return string (js ), nil
2929}
3030
3131func MarshalJSONIndentNoError (input any ) string {
32- js , err := sonic .MarshalIndent (input , "" , " " )
32+ js , err := json .MarshalIndent (input , "" , " " )
3333 if err != nil {
3434 return ""
3535 }
3636 return string (js )
3737}
3838
3939func MarshalJSONBytes (input any ) ([]byte , error ) {
40- return sonic .Marshal (input )
40+ return json .Marshal (input )
4141}
4242
4343func UnmarshalJSON (input string , output any ) error {
44- return sonic . UnmarshalString ( input , output )
44+ return json . Unmarshal ([] byte ( input ) , output )
4545}
4646
4747func UnmarshalJSONBytes (input []byte , output any ) error {
48- return sonic .Unmarshal (input , output )
48+ return json .Unmarshal (input , output )
4949}
You can’t perform that action at this time.
0 commit comments