3pl/util/pjson/bytes.go

17 lines
265 B
Go

package pjson
import (
"encoding/json"
"git.selly.red/Selly-Modules/logger"
)
// ToBytes ...
func ToBytes(data interface{}) []byte {
b, err := json.Marshal(data)
if err != nil {
logger.Error("pjson.ToBytes", logger.LogData{"payload": data})
}
return b
}