Files
steam_analyzer/internal/utils/jsonutils/jsonutils.go
2026-01-17 22:45:02 +03:00

17 lines
247 B
Go

package jsonutils
import (
"encoding/json"
"io"
)
func ToJSON(w io.Writer, v interface{}) error {
e := json.NewEncoder(w)
return e.Encode(v)
}
func FromJSON(r io.Reader, v interface{}) error {
d := json.NewDecoder(r)
return d.Decode(v)
}