all: simplify s[:] to s where s is a slice (#17673)

This commit is contained in:
Emil
2018-09-14 23:07:13 +03:00
committed by Felix Lange
parent 7bb95a9a64
commit 86a03f97d3
14 changed files with 28 additions and 28 deletions

View File

@ -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
}
}