all: Apply staticcheck recommendations

This commit is contained in:
Bjørn Erik Pedersen
2019-03-24 10:11:16 +01:00
parent 3011f36c27
commit b5f39d23b8
41 changed files with 98 additions and 252 deletions

View File

@@ -114,9 +114,9 @@ func TestScpGetRemote(t *testing.T) {
ns.client = cl
var c []byte
f := func(b []byte) (error, bool) {
f := func(b []byte) (bool, error) {
c = b
return nil, false
return false, nil
}
err = ns.getRemote(cache, f, req)
@@ -158,15 +158,15 @@ func TestScpGetRemoteParallel(t *testing.T) {
defer wg.Done()
for j := 0; j < 10; j++ {
var c []byte
f := func(b []byte) (error, bool) {
f := func(b []byte) (bool, error) {
c = b
return nil, false
return false, nil
}
err := ns.getRemote(ns.cacheGetJSON, f, req)
assert.NoError(t, err)
if string(content) != string(c) {
t.Fatalf("expected\n%q\ngot\n%q", content, c)
t.Errorf("expected\n%q\ngot\n%q", content, c)
}
time.Sleep(23 * time.Millisecond)