pkg/json/sonic.go   A
last analyzed

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 8
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A json.*SonicJSON.Marshal 0 2 1
A json.*SonicJSON.Unmarshal 0 2 1
1
package json
2
3
import (
4
	"github.com/bytedance/sonic"
5
)
6
7
type SonicJSON struct{}
8
9
func (s *SonicJSON) Marshal(v interface{}) ([]byte, error) {
10
	return sonic.Marshal(v)
11
}
12
13
func (s *SonicJSON) Unmarshal(data []byte, v interface{}) error {
14
	return sonic.Unmarshal(data, v)
15
}
16