Enable gosimple and ineffasign linters

This commit is contained in:
Andrey Smirnov
2017-04-27 18:34:30 +03:00
parent 7a7b981d4f
commit bae3f949b4
16 changed files with 32 additions and 49 deletions
+1 -1
View File
@@ -646,7 +646,7 @@ func (objr objectResource) put(a *action) interface{} {
fatalError(400, "TODO", "read error")
}
gotHash := sum.Sum(nil)
if expectHash != nil && bytes.Compare(gotHash, expectHash) != 0 {
if expectHash != nil && !bytes.Equal(gotHash, expectHash) {
fatalError(400, "BadDigest", "The Content-MD5 you specified did not match what we received")
}
if a.req.ContentLength >= 0 && int64(len(data)) != a.req.ContentLength {