aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/http
diff options
context:
space:
mode:
authorEgon Elbre <egonelbre@gmail.com>2017-08-09 01:34:35 +0800
committerEgon Elbre <egonelbre@gmail.com>2017-08-14 23:12:37 +0800
commit133de3d80659680dc051065cb3baddd92a4e45c5 (patch)
treecc67ede99634e335f8a07a5b0b084877cb8282d7 /swarm/api/http
parent6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f (diff)
downloadgo-tangerine-133de3d80659680dc051065cb3baddd92a4e45c5.tar
go-tangerine-133de3d80659680dc051065cb3baddd92a4e45c5.tar.gz
go-tangerine-133de3d80659680dc051065cb3baddd92a4e45c5.tar.bz2
go-tangerine-133de3d80659680dc051065cb3baddd92a4e45c5.tar.lz
go-tangerine-133de3d80659680dc051065cb3baddd92a4e45c5.tar.xz
go-tangerine-133de3d80659680dc051065cb3baddd92a4e45c5.tar.zst
go-tangerine-133de3d80659680dc051065cb3baddd92a4e45c5.zip
swarm: fix megacheck warnings
Diffstat (limited to 'swarm/api/http')
-rw-r--r--swarm/api/http/server.go2
-rw-r--r--swarm/api/http/server_test.go5
2 files changed, 5 insertions, 2 deletions
diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go
index b4032839a..0b4ec7e18 100644
--- a/swarm/api/http/server.go
+++ b/swarm/api/http/server.go
@@ -224,7 +224,7 @@ func (s *Server) handleMultipartUpload(req *Request, boundary string, mw *api.Ma
if err != nil {
return fmt.Errorf("error copying multipart content: %s", err)
}
- if _, err := tmp.Seek(0, os.SEEK_SET); err != nil {
+ if _, err := tmp.Seek(0, io.SeekStart); err != nil {
return fmt.Errorf("error copying multipart content: %s", err)
}
reader = tmp
diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go
index 14abd1df4..d3374594b 100644
--- a/swarm/api/http/server_test.go
+++ b/swarm/api/http/server_test.go
@@ -97,7 +97,7 @@ func TestBzzrGetPath(t *testing.T) {
isexpectedfailrequest = true
}
}
- if isexpectedfailrequest == false {
+ if !isexpectedfailrequest {
t.Fatalf("Response body does not match, expected: %v, got %v", testmanifest[v], string(respbody))
}
}
@@ -126,6 +126,9 @@ func TestBzzrGetPath(t *testing.T) {
}
defer resp.Body.Close()
respbody, err = ioutil.ReadAll(resp.Body)
+ if err != nil {
+ t.Fatalf("ReadAll failed: %v", err)
+ }
if string(respbody) != nonhashresponses[i] {
t.Fatalf("Non-Hash response body does not match, expected: %v, got: %v", nonhashresponses[i], string(respbody))
}