Passed
Push — main ( f0dc1d...8ca1be )
by Yume
01:47 queued 29s
created

pkg/json/go-json.go   A

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A json.*GoJSON.Marshal 0 2 1
A json.*GoJSON.Unmarshal 0 2 1
1
package json
2
3
import (
4
	"github.com/goccy/go-json"
5
)
6
7
// GoJSON is a wrapper for goccy/go-json.
8
type GoJSON struct{}
9
10
// Marshal marshals the given value to JSON.
11
func (*GoJSON) Marshal(v interface{}) ([]byte, error) {
12
	return json.Marshal(v)
13
}
14
15
// Unmarshal unmarshals the given JSON to the given value.
16
func (*GoJSON) Unmarshal(data []byte, v interface{}) error {
17
	return json.Unmarshal(data, v)
18
}
19