3pl/util/pjson/unmarshal.go

20 lines
322 B
Go
Raw Normal View History

2022-08-15 04:51:07 +00:00
package pjson
import (
"encoding/json"
2022-10-10 03:45:16 +00:00
"git.selly.red/Selly-Modules/logger"
2022-08-15 04:51:07 +00:00
)
// Unmarshal ...
func Unmarshal(b []byte, resultP interface{}) error {
err := json.Unmarshal(b, resultP)
if err != nil {
logger.Error("pjson.Unmarshal", logger.LogData{
"raw": string(b),
"err": err.Error(),
})
}
return err
}