From 30b4909814ad9c4b33568f1c2b14248aacb401fb Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 23 Sep 2021 12:01:07 +0000 Subject: [PATCH] Format code with gofmt This commit fixes the style issues introduced in bda217d according to the output from gofmt. Details: https://deepsource.io/gh/subham-deepsource/redcon/transform/5d5d0ff7-5ff4-451f-9009-d3934b714f85/ --- resp.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/resp.go b/resp.go index 1d70c3f..ab6e212 100644 --- a/resp.go +++ b/resp.go @@ -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 { @@ -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