diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2018-11-08 03:39:08 +0800 |
---|---|---|
committer | Viktor TrĂ³n <viktor.tron@gmail.com> | 2018-11-08 03:39:08 +0800 |
commit | cf3b187bdef59078ba6570a2f5ee046ab87bcefd (patch) | |
tree | fbc16d9216df0d32e745f88cb3ac22e6dab256bf /swarm/api/http | |
parent | 81533deae5ee4a7ec08842e2b6647f3affde5a71 (diff) | |
download | dexon-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar dexon-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.gz dexon-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.bz2 dexon-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.lz dexon-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.xz dexon-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.zst dexon-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.zip |
swarm, cmd/swarm: address ineffectual assignments (#18048)
* swarm, cmd/swarm: address ineffectual assignments
* swarm/network: remove unused vars from testHandshake
* swarm/storage/feed: revert cursor changes
Diffstat (limited to 'swarm/api/http')
-rw-r--r-- | swarm/api/http/server.go | 2 | ||||
-rw-r--r-- | swarm/api/http/server_test.go | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go index 803b78987..3c6735a73 100644 --- a/swarm/api/http/server.go +++ b/swarm/api/http/server.go @@ -366,7 +366,7 @@ func (s *Server) handleMultipartUpload(r *http.Request, boundary string, mw *api } var size int64 - var reader io.Reader = part + var reader io.Reader if contentLength := part.Header.Get("Content-Length"); contentLength != "" { size, err = strconv.ParseInt(contentLength, 10, 64) if err != nil { diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go index 159c8a159..04d0e045a 100644 --- a/swarm/api/http/server_test.go +++ b/swarm/api/http/server_test.go @@ -263,7 +263,7 @@ func TestBzzFeed(t *testing.T) { if resp.StatusCode == http.StatusOK { t.Fatal("Expected error status since feed update does not contain multihash. Received 200 OK") } - b, err = ioutil.ReadAll(resp.Body) + _, err = ioutil.ReadAll(resp.Body) if err != nil { t.Fatal(err) } @@ -491,6 +491,9 @@ func testBzzGetPath(encrypted bool, t *testing.T) { } defer resp.Body.Close() respbody, err = ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatalf("Error while reading response body: %v", err) + } if string(respbody) != testmanifest[v] { isexpectedfailrequest := false |