3pl/util/pjson/bytes.go

17 lines
265 B
Go
Raw Permalink 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
)
// ToBytes ...
func ToBytes(data interface{}) []byte {
b, err := json.Marshal(data)
if err != nil {
logger.Error("pjson.ToBytes", logger.LogData{"payload": data})
}
return b
}