Files
storm/codec/json/json.go
2016-09-24 13:28:52 +02:00

20 lines
397 B
Go

// Package json contains a codec to encode and decode entities in JSON format
package json
import (
"encoding/json"
)
// Codec that encodes to and decodes from JSON.
var Codec = new(jsonCodec)
type jsonCodec int
func (j jsonCodec) Marshal(v interface{}) ([]byte, error) {
return json.Marshal(v)
}
func (j jsonCodec) Unmarshal(b []byte, v interface{}) error {
return json.Unmarshal(b, v)
}