test
This commit is contained in:
parent
4a0618dcf5
commit
f73b77e097
7
mq.go
7
mq.go
@ -5,16 +5,15 @@ import (
|
||||
)
|
||||
|
||||
func (c *MQClient) Open() error {
|
||||
conn, err := amqp.Dial("amqp://" + c.User + ":" + c.Password + "@" + c.Host + "/" + c.Path)
|
||||
c.Connection = conn
|
||||
var err error
|
||||
c.Connection, err = amqp.Dial("amqp://" + c.User + ":" + c.Password + "@" + c.Host + "/" + c.Path)
|
||||
|
||||
if err != nil {
|
||||
c.Connection.Close()
|
||||
return err
|
||||
}
|
||||
|
||||
ch, err := c.Connection.Channel()
|
||||
c.Channel = ch
|
||||
c.Channel, err = c.Connection.Channel()
|
||||
if err != nil {
|
||||
c.Channel.Close()
|
||||
c.Connection.Close()
|
||||
|
Loading…
Reference in New Issue
Block a user