package njson import ( "git.noahlan.cn/noahlan/ntool/ndef" ) type JsonSerializer struct { } func NewJsonSerializer() ndef.Serializer { return &JsonSerializer{} } func (s *JsonSerializer) Marshal(v any) ([]byte, error) { marshal, err := Marshal(v) if err != nil { return nil, err } return marshal, nil } func (s *JsonSerializer) Unmarshal(data []byte, v any) error { return Unmarshal(data, v) }