14 lines
283 B
Go
14 lines
283 B
Go
package corelib
|
|
|
|
import "encoding/json"
|
|
|
|
// JsonMarshal JSON封装
|
|
func JsonMarshal(src interface{}) (res []byte, err error) {
|
|
return json.Marshal(src)
|
|
}
|
|
|
|
// JsonUnmarshal JSON解封
|
|
func JsonUnmarshal(data []byte, res interface{}) (err error) {
|
|
return json.Unmarshal(data, res)
|
|
}
|