From 8daf486355aa4dc74ee0bd2f621cabaee802f0d7 Mon Sep 17 00:00:00 2001 From: Mitsuko Megumi Date: Sat, 8 Dec 2018 00:38:57 -0500 Subject: [PATCH] Swarm http api, shed, pss: fixed ineff got, err assigns in unit tests. --- swarm/api/http/response_test.go | 10 +++++----- swarm/shed/index_test.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/swarm/api/http/response_test.go b/swarm/api/http/response_test.go index 486c19ab0e..8ebee49aff 100644 --- a/swarm/api/http/response_test.go +++ b/swarm/api/http/response_test.go @@ -40,7 +40,7 @@ func TestError(t *testing.T) { t.Fatalf("Request failed: %v", err) } defer resp.Body.Close() - respbody, err = ioutil.ReadAll(resp.Body) + respbody, _ = ioutil.ReadAll(resp.Body) if resp.StatusCode != 404 && !strings.Contains(string(respbody), "Invalid URI "/this_should_fail_as_no_bzz_protocol_present": unknown scheme") { t.Fatalf("Response body does not match, expected: %v, to contain: %v; received code %d, expected code: %d", string(respbody), "Invalid bzz URI: unknown scheme", 400, resp.StatusCode) @@ -66,7 +66,7 @@ func Test404Page(t *testing.T) { t.Fatalf("Request failed: %v", err) } defer resp.Body.Close() - respbody, err = ioutil.ReadAll(resp.Body) + respbody, _ = ioutil.ReadAll(resp.Body) if resp.StatusCode != 404 || !strings.Contains(string(respbody), "404") { t.Fatalf("Invalid Status Code received, expected 404, got %d", resp.StatusCode) @@ -92,7 +92,7 @@ func Test500Page(t *testing.T) { t.Fatalf("Request failed: %v", err) } defer resp.Body.Close() - respbody, err = ioutil.ReadAll(resp.Body) + respbody, _ = ioutil.ReadAll(resp.Body) if resp.StatusCode != 404 { t.Fatalf("Invalid Status Code received, expected 404, got %d", resp.StatusCode) @@ -117,7 +117,7 @@ func Test500PageWith0xHashPrefix(t *testing.T) { t.Fatalf("Request failed: %v", err) } defer resp.Body.Close() - respbody, err = ioutil.ReadAll(resp.Body) + respbody, _ = ioutil.ReadAll(resp.Body) if resp.StatusCode != 404 { t.Fatalf("Invalid Status Code received, expected 404, got %d", resp.StatusCode) @@ -152,7 +152,7 @@ func TestJsonResponse(t *testing.T) { } defer resp.Body.Close() - respbody, err = ioutil.ReadAll(resp.Body) + respbody, _ = ioutil.ReadAll(resp.Body) if resp.StatusCode != 404 { t.Fatalf("Invalid Status Code received, expected 404, got %d", resp.StatusCode) diff --git a/swarm/shed/index_test.go b/swarm/shed/index_test.go index ba82216dfe..f5a24e0a7c 100644 --- a/swarm/shed/index_test.go +++ b/swarm/shed/index_test.go @@ -204,7 +204,7 @@ func TestIndex(t *testing.T) { } wantErr := leveldb.ErrNotFound - got, err = index.Get(IndexItem{ + _, err = index.Get(IndexItem{ Address: want.Address, }) if err != wantErr { @@ -241,7 +241,7 @@ func TestIndex(t *testing.T) { } wantErr := leveldb.ErrNotFound - got, err = index.Get(IndexItem{ + _, err = index.Get(IndexItem{ Address: want.Address, }) if err != wantErr {