only check for newline instead of newline and carraiage return

Co-authored-by: Cristian Maglie <c.maglie@bug.st>
This commit is contained in:
Lukas Becker
2020-05-08 13:40:05 +02:00
committed by Cristian Maglie
parent b0154211af
commit 578b2ec832

View File

@@ -64,11 +64,11 @@ func Example_sendAndReceive() {
break break
} }
if strings.Contains(string(buff[:n]), "\n\r") { //if we receive a newline and carriage return, stop reading fmt.Printf("%s", string(buff[:n]))
fmt.Printf("%v", string(buff)) //Print the data we received // If we receive a newline stop reading
if strings.Contains(string(buff[:n]), "\n") {
break break
} }
} }
} }