Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Format code with gofmt
This commit fixes the style issues introduced in bda217d according to the output
from gofmt.

Details: https://deepsource.icu/gh/subham-deepsource/redcon/transform/2c8c9a01-8759-4221-8cb0-1228f9e2fd45/
  • Loading branch information
deepsource-dev-autofix[bot] authored Mar 2, 2022
commit c0518608e8de070db9207c6009e50f51045efd41
11 changes: 5 additions & 6 deletions resp.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (r *RESP) ForEach(iter func(resp RESP) bool) {
// took up the result.
func ReadNextRESP(b []byte) (n int, resp RESP) {
if len(b) == 0 {
return 0, RESP{} // no data to read
return 0, RESP{} // no data to read
}
resp.Type = Type(b[0])
switch resp.Type {
Expand All @@ -57,18 +57,17 @@ func ReadNextRESP(b []byte) (n int, resp RESP) {
for ; ; i++ {
if i == len(b) {
return 0, RESP{} // not enough data
}
}
if b[i] == '\n' {


if b[i-1] != '\r' {

if b[i-1] != '\r' {
return 0, RESP{} //, missing CR character
}
i++
break
}
}
resp.Raw = b[0:i]
resp.Raw = b[0:i]
resp.Data = b[1 : i-2]
if resp.Type == Integer {
// Integer
Expand Down