| Total Lines | 17 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |