diff --git a/cmd/clientFunc.go b/cmd/clientFunc.go index 85ef25e..f91bd1b 100644 --- a/cmd/clientFunc.go +++ b/cmd/clientFunc.go @@ -165,9 +165,9 @@ func sendName(conn net.Conn) { if err != nil { log.Fatalf("Error occurred sending message to server: %v\n", err) } - Profile.Username = strings.TrimRight(message, "\n") + Profile.Username = strings.TrimRight(message, "\n\r") - if _, err := conn.Write([]byte(message)); err != nil { + if _, err := conn.Write([]byte(Profile.Username + "\n")); err != nil { log.Fatalf("Error occurred writing to server: %v\n", err) } }