File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 11package rabbitmq
22
33import (
4- "bytes"
5- "encoding/gob"
4+ "fmt"
65
76 "github.com/streadway/amqp"
87
@@ -93,21 +92,14 @@ func (c storage) Name() string {
9392// @param value that will be pushed
9493// @return an error if the push failed
9594func (c storage ) Push (value interface {}) error {
96- var buf bytes.Buffer
97-
98- enc := gob .NewEncoder (& buf )
99- if err := enc .Encode (value ); err != nil {
100- return err
101- }
102-
10395 if err := c .channel .Publish (
10496 c .config .Exchange ,
10597 c .routingKey .Name ,
10698 c .config .Mandatory ,
10799 c .config .Immediate ,
108100 amqp.Publishing {
109101 ContentType : c .config .ContentType (),
110- Body : []byte (buf . Bytes ( )),
102+ Body : []byte (fmt . Sprintf ( "%v" , value )),
111103 }); err != nil {
112104 return err
113105 }
You can’t perform that action at this time.
0 commit comments