vfs: explicitly ignore unused variables

s3-about
Lars Lehtonen 2020-02-12 03:20:54 -08:00 committed by GitHub
parent b71e1a16b1
commit 4e1a511f88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -333,7 +333,7 @@ func TestCacheOpenMkdir(t *testing.T) {
assert.Equal(t, []string(nil), itemAsString(c))
// test directory does not exist
fi, err = os.Stat(filepath.Dir(p))
_, err = os.Stat(filepath.Dir(p))
require.True(t, os.IsNotExist(err))
}

View File

@ -238,7 +238,7 @@ func TestDirStat(t *testing.T) {
assert.Equal(t, int64(14), node.Size())
assert.Equal(t, "file1", node.Name())
node, err = dir.Stat("not found")
_, err = dir.Stat("not found")
assert.Equal(t, ENOENT, err)
}
@ -293,7 +293,7 @@ func TestDirOpen(t *testing.T) {
assert.True(t, ok)
require.NoError(t, fd.Close())
fd, err = dir.Open(os.O_WRONLY)
_, err = dir.Open(os.O_WRONLY)
assert.Equal(t, EPERM, err)
}
@ -405,7 +405,7 @@ func TestDirRemove(t *testing.T) {
require.NoError(t, err)
// check directory is not there
node, err = vfs.Stat("dir")
_, err = vfs.Stat("dir")
assert.Equal(t, ENOENT, err)
// check the vfs

View File

@ -238,7 +238,7 @@ func TestFileOpen(t *testing.T) {
_, ok = fd.(*WriteFileHandle)
assert.True(t, ok)
fd, err = file.Open(3)
_, err = file.Open(3)
assert.Equal(t, EPERM, err)
}

View File

@ -152,16 +152,16 @@ func TestVFSStat(t *testing.T) {
assert.True(t, node.IsFile())
assert.Equal(t, "file2", node.Name())
node, err = vfs.Stat("not found")
_, err = vfs.Stat("not found")
assert.Equal(t, os.ErrNotExist, err)
node, err = vfs.Stat("dir/not found")
_, err = vfs.Stat("dir/not found")
assert.Equal(t, os.ErrNotExist, err)
node, err = vfs.Stat("not found/not found")
_, err = vfs.Stat("not found/not found")
assert.Equal(t, os.ErrNotExist, err)
node, err = vfs.Stat("file1/under a file")
_, err = vfs.Stat("file1/under a file")
assert.Equal(t, os.ErrNotExist, err)
}