Fix problems found with ineffassign

This commit is contained in:
Nick Craig-Wood
2017-06-13 11:52:36 +01:00
parent 28fcc53e45
commit 740b3f6ae2
9 changed files with 19 additions and 16 deletions
+4 -4
View File
@@ -216,14 +216,14 @@ func findObject(t *testing.T, Name string) fs.Object {
}
func testPut(t *testing.T, file *fstest.Item) string {
tries := 1
const maxTries = 10
again:
contents := fstest.RandomString(100)
buf := bytes.NewBufferString(contents)
hash := fs.NewMultiHasher()
in := io.TeeReader(buf, hash)
tries := 1
const maxTries = 10
file.Size = int64(buf.Len())
obji := fs.NewStaticObjectInfo(file.Path, file.ModTime, file.Size, true, nil, nil)
obj, err := remote.Put(in, obji)
@@ -274,11 +274,11 @@ func TestFsPutError(t *testing.T) {
in := io.MultiReader(buf, er)
obji := fs.NewStaticObjectInfo(file2.Path, file2.ModTime, 100, true, nil, nil)
obj, err := remote.Put(in, obji)
_, err := remote.Put(in, obji)
// assert.Nil(t, obj) - FIXME some remotes return the object even on nil
assert.NotNil(t, err)
obj, err = remote.NewObject(file2.Path)
obj, err := remote.NewObject(file2.Path)
assert.Nil(t, obj)
assert.Equal(t, fs.ErrorObjectNotFound, err)
}