mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 15:53:28 +03:00
remove ReadFileWithVerify from StorageAPI (#4947)
This change removes the ReadFileWithVerify function from the StorageAPI. The ReadFile was basically a redirection to ReadFileWithVerify. This change removes the redirection and moves the logic of ReadFileWithVerify directly into ReadFile. This removes a lot of unnecessary code in all StorageAPI implementations. Fixes #4946 * review: fix doc and typos
This commit is contained in:
committed by
Dee Koder
parent
4cadb33da2
commit
7e6b5bdbb7
@@ -290,7 +290,7 @@ func TestRetryStorage(t *testing.T) {
|
||||
for _, disk := range storageDisks {
|
||||
var buf2 = make([]byte, 5)
|
||||
var n int64
|
||||
if n, err = disk.ReadFile("existent", "path", 7, buf2); err != nil {
|
||||
if n, err = disk.ReadFile("existent", "path", 7, buf2, nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err != nil {
|
||||
@@ -312,11 +312,11 @@ func TestRetryStorage(t *testing.T) {
|
||||
var buf2 = make([]byte, 5)
|
||||
verifier := NewBitrotVerifier(SHA256, sha256Hash([]byte("Hello, World")))
|
||||
var n int64
|
||||
if n, err = disk.ReadFileWithVerify("existent", "path", 7, buf2, verifier); err != nil {
|
||||
if n, err = disk.ReadFile("existent", "path", 7, buf2, verifier); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err != nil {
|
||||
t.Error("Error in ReadFileWithVerify", err)
|
||||
t.Error("Error in ReadFile with bitrot verification", err)
|
||||
}
|
||||
if n != 5 {
|
||||
t.Fatalf("Expected 5, got %d", n)
|
||||
|
||||
Reference in New Issue
Block a user