Merge pull request #343 from lennycampino/nats-endpoint

fixed missing else statement when creating nats connection
This commit is contained in:
Josh Baker 2018-08-09 08:22:21 -07:00 committed by GitHub
commit 4e8a7ccfcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -63,8 +63,9 @@ func (conn *NATSConn) Send(msg string) error {
var err error
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))
} else {
conn.conn, err = nats.Connect(addr)
}
conn.conn, err = nats.Connect(addr)
if err != nil {
conn.close()
return err