Shriram Rajagopalan 9 vuotta sitten
vanhempi
commit
6fbcb5f07e
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      broker.go

+ 2 - 2
broker.go

@@ -488,9 +488,9 @@ func (b *Broker) responseReceiver() {
 // of responding to bad credentials but thats how its being done today.
 func (b *Broker) doSASLPlainAuth() error {
 	length := 1 + len(b.conf.Net.SASL.User) + 1 + len(b.conf.Net.SASL.Password)
-	authBytes := make([]byte, length + 4)  //4 byte length header + auth data
+	authBytes := make([]byte, length+4) //4 byte length header + auth data
 	binary.BigEndian.PutUint32(authBytes, uint32(length))
-	copy(authBytes[4:], []byte("\x00" + b.conf.Net.SASL.User + "\x00" + b.conf.Net.SASL.Password))
+	copy(authBytes[4:], []byte("\x00"+b.conf.Net.SASL.User+"\x00"+b.conf.Net.SASL.Password))
 
 	b.conn.SetWriteDeadline(time.Now().Add(b.conf.Net.WriteTimeout))
 	b.conn.Write(authBytes)