3pl/util/pjson/unmarshal.go

20 lines
322 B
Go

package pjson
import (
"encoding/json"
"git.selly.red/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
}