Files
x/encoding/json/json.go
Colin Henry 54aae5f242
All checks were successful
Go / build (1.23) (push) Successful in 3m51s
big updates: tests, bug fixed, documentation. oh my
2026-01-03 15:53:50 -08:00

18 lines
376 B
Go

// Package json provides JSON encoder and decoder functions.
package json
import (
"encoding/json"
"io"
)
// Encoder encodes data as JSON to a writer.
func Encoder(w io.Writer, e interface{}) error {
return json.NewEncoder(w).Encode(e)
}
// Decoder decodes JSON data from a reader.
func Decoder(r io.Reader, e interface{}) error {
return json.NewDecoder(r).Decode(e)
}