style(go-pkg): rename pkg

This commit is contained in:
pyihe
2022-03-04 17:24:23 +08:00
parent 520fd7269b
commit cd80673d8b
61 changed files with 751 additions and 1006 deletions

17
serialize/json.go Normal file
View File

@@ -0,0 +1,17 @@
package serialize
import "encoding/json"
type jsonSerializer struct{}
func JSON() Serializer {
return jsonSerializer{}
}
func (js jsonSerializer) Encode(v interface{}) (data []byte, err error) {
return json.Marshal(v)
}
func (js jsonSerializer) Decode(data []byte, v interface{}) error {
return json.Unmarshal(data, v)
}