diff options
author | Emil <mursalimovemeel@gmail.com> | 2018-09-15 04:07:13 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-09-15 04:07:13 +0800 |
commit | 86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32 (patch) | |
tree | 92ee61a4d5a2c750b6abc257f30b040485e29842 /swarm/api | |
parent | 7bb95a9a64c9d26bef4f15fdd9301bb0b5cdb668 (diff) | |
download | go-tangerine-86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32.tar go-tangerine-86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32.tar.gz go-tangerine-86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32.tar.bz2 go-tangerine-86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32.tar.lz go-tangerine-86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32.tar.xz go-tangerine-86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32.tar.zst go-tangerine-86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32.zip |
all: simplify s[:] to s where s is a slice (#17673)
Diffstat (limited to 'swarm/api')
-rw-r--r-- | swarm/api/http/server_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
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 } } |