mirror of https://github.com/tidwall/tile38.git
Merge pull request #343 from lennycampino/nats-endpoint
fixed missing else statement when creating nats connection
This commit is contained in:
commit
4e8a7ccfcd
|
@ -63,8 +63,9 @@ func (conn *NATSConn) Send(msg string) error {
|
||||||
var err error
|
var err error
|
||||||
if conn.ep.NATS.User != "" && conn.ep.NATS.Pass != "" {
|
if conn.ep.NATS.User != "" && conn.ep.NATS.Pass != "" {
|
||||||
conn.conn, err = nats.Connect(addr, nats.UserInfo(conn.ep.NATS.User, conn.ep.NATS.Pass))
|
conn.conn, err = nats.Connect(addr, nats.UserInfo(conn.ep.NATS.User, conn.ep.NATS.Pass))
|
||||||
}
|
} else {
|
||||||
conn.conn, err = nats.Connect(addr)
|
conn.conn, err = nats.Connect(addr)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
conn.close()
|
conn.close()
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue