3pl/util/pjson/unmarshal.go

20 lines
319 B
Go
Raw Normal View History

2022-08-15 04:51:07 +00:00
package pjson
import (
"encoding/json"
"github.com/Selly-Modules/logger"
)
// 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
}