From 86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32 Mon Sep 17 00:00:00 2001 From: Emil Date: Fri, 14 Sep 2018 23:07:13 +0300 Subject: all: simplify s[:] to s where s is a slice (#17673) --- swarm/api/http/server_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'swarm/api') diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go index 2acdbd1ad..4a3ca0429 100644 --- a/swarm/api/http/server_test.go +++ b/swarm/api/http/server_test.go @@ -501,7 +501,7 @@ func testBzzGetPath(encrypted bool, t *testing.T) { var respbody []byte url := srv.URL + "/bzz-raw:/" - if k[:] != "" { + if k != "" { url += rootRef + "/" + k[1:] + "?content_type=text/plain" } resp, err = http.Get(url) @@ -515,7 +515,7 @@ func testBzzGetPath(encrypted bool, t *testing.T) { isexpectedfailrequest := false for _, r := range expectedfailrequests { - if k[:] == r { + if k == r { isexpectedfailrequest = true } } @@ -530,7 +530,7 @@ func testBzzGetPath(encrypted bool, t *testing.T) { var respbody []byte url := srv.URL + "/bzz-hash:/" - if k[:] != "" { + if k != "" { url += rootRef + "/" + k[1:] } resp, err = http.Get(url) @@ -547,7 +547,7 @@ func testBzzGetPath(encrypted bool, t *testing.T) { isexpectedfailrequest := false for _, r := range expectedfailrequests { - if k[:] == r { + if k == r { isexpectedfailrequest = true } } @@ -599,7 +599,7 @@ func testBzzGetPath(encrypted bool, t *testing.T) { } { k := c.path url := srv.URL + "/bzz-list:/" - if k[:] != "" { + if k != "" { url += rootRef + "/" + k[1:] } t.Run("json list "+c.path, func(t *testing.T) { @@ -618,7 +618,7 @@ func testBzzGetPath(encrypted bool, t *testing.T) { isexpectedfailrequest := false for _, r := range expectedfailrequests { - if k[:] == r { + if k == r { isexpectedfailrequest = true } } @@ -650,7 +650,7 @@ func testBzzGetPath(encrypted bool, t *testing.T) { isexpectedfailrequest := false for _, r := range expectedfailrequests { - if k[:] == r { + if k == r { isexpectedfailrequest = true } } -- cgit v1.2.3