only check for newline instead of newline and carraiage return
Co-authored-by: Cristian Maglie <c.maglie@bug.st>
This commit is contained in:
committed by
Cristian Maglie
parent
b0154211af
commit
578b2ec832
@@ -64,11 +64,11 @@ func Example_sendAndReceive() {
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user