utils update

This commit is contained in:
away 2021-07-15 11:18:31 +08:00
parent 59522ea387
commit 0d9febc406

View File

@ -47,3 +47,9 @@ func StructToJsonString(param interface{}) string {
dataString := string(dataType)
return dataString
}
//The incoming parameter must be a pointer
func JsonStringToStruct(s string, args interface{}) error {
err := json.Unmarshal([]byte(s), args)
return err
}