nip/internal/pkg/encoding/decoder.go

19 lines
249 B
Go

package encoding
import (
"encoding/json"
"io"
)
type decoder struct {
r io.Reader
}
func NewDecoder(r io.Reader) Decoder {
return &decoder{r}
}
func (d *decoder) Decode(v interface{}) (err error) {
return json.NewDecoder(d.r).Decode(&v)
}