File: decoder.go

package info (click to toggle)
golang-github-thedevsaddam-gojsonq 2.5.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 476 kB
  • sloc: makefile: 36
file content (16 lines) | stat: -rw-r--r-- 398 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package gojsonq

import "encoding/json"

// Decoder provide contract to decode JSON using custom decoder
type Decoder interface {
	Decode(data []byte, v interface{}) error
}

// DefaultDecoder use json.Unmarshal to decode JSON
type DefaultDecoder struct{}

// Decode decodes using json.Unmarshal
func (u *DefaultDecoder) Decode(data []byte, v interface{}) error {
	return json.Unmarshal(data, v)
}