natsio/client/util.go

15 lines
214 B
Go
Raw Permalink Normal View History

2022-08-18 10:47:47 +00:00
package client
import (
"encoding/json"
"log"
)
func toBytes(data interface{}) []byte {
b, err := json.Marshal(data)
if err != nil {
log.Printf("natsio/client.toBytes: marshal_json %v", err)
}
return b
}