Commit 5f6c4202 authored by ale's avatar ale
Browse files

Directly write the 'auth' command with conn.PrintfLine

parent b9fd2573
Pipeline #2974 passed with stages
in 2 minutes and 23 seconds
package client
import (
......@@ -47,11 +45,8 @@ func (c *socketClient) Authenticate(ctx context.Context, req *auth.Request) (*au
go func() {
defer close(done)
// Write the command to a buffer.
var buf bytes.Buffer
io.WriteString(&buf, "auth ")
if err := conn.PrintfLine(buf.String()); err != nil {
// Write the auth command to the connection.
if err := conn.PrintfLine("auth %s", string(c.codec.Encode(req))); err != nil {
done <- err
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment