package json import ( "encoding/json" "git.noahlan.cn/noahlan/ntool/ndef" ) type Serializer struct{} func NewSerializer() ndef.Serializer { return &Serializer{} } func (s *Serializer) Marshal(i interface{}) ([]byte, error) { return json.Marshal(i) } func (s *Serializer) Unmarshal(bytes []byte, i interface{}) error { return json.Unmarshal(bytes, i) }