fix(cmd): handle errors and improve output formatting
* update error handling in various commands to use blank identifier * enhance output formatting for better readability * add golangci-lint to Makefile for linting checks
This commit is contained in:
@@ -51,7 +51,7 @@ func readResp(t *testing.T, buf *bytes.Buffer) map[string]interface{} {
|
||||
}
|
||||
lenStr := string(data[idx+16 : idx+eol])
|
||||
var n int
|
||||
fmt.Sscanf(lenStr, "%d", &n)
|
||||
_, _ = fmt.Sscanf(lenStr, "%d", &n)
|
||||
sep := bytes.Index(data, []byte("\r\n\r\n"))
|
||||
if sep < 0 || len(data) < sep+4+n {
|
||||
time.Sleep(5 * time.Millisecond)
|
||||
@@ -60,7 +60,7 @@ func readResp(t *testing.T, buf *bytes.Buffer) map[string]interface{} {
|
||||
body := data[sep+4 : sep+4+n]
|
||||
buf.Next(sep + 4 + n)
|
||||
var result map[string]interface{}
|
||||
json.Unmarshal(body, &result)
|
||||
_ = json.Unmarshal(body, &result)
|
||||
return result
|
||||
}
|
||||
t.Fatal("timeout waiting for response")
|
||||
|
||||
Reference in New Issue
Block a user