mirror of
https://github.com/restic/restic.git
synced 2025-10-17 07:22:07 +00:00
backend: Remove Get()
This is the first commit that removes the (redundant) Get() method of the backend interface. Get(x, y) is equivalent to GetReader(x, y, 0, 0).
This commit is contained in:
@@ -647,7 +647,7 @@ func (c *Checker) CountPacks() uint64 {
|
||||
// checkPack reads a pack and checks the integrity of all blobs.
|
||||
func checkPack(r *repository.Repository, id backend.ID) error {
|
||||
debug.Log("Checker.checkPack", "checking pack %v", id.Str())
|
||||
rd, err := r.Backend().Get(backend.Data, id.String())
|
||||
rd, err := r.Backend().GetReader(backend.Data, id.String(), 0, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@@ -214,19 +214,6 @@ type errorBackend struct {
|
||||
backend.Backend
|
||||
}
|
||||
|
||||
func (b errorBackend) Get(t backend.Type, name string) (io.ReadCloser, error) {
|
||||
rd, err := b.Backend.Get(t, name)
|
||||
if err != nil {
|
||||
return rd, err
|
||||
}
|
||||
|
||||
if t != backend.Data {
|
||||
return rd, err
|
||||
}
|
||||
|
||||
return backend.ReadCloser(faultReader{rd}), nil
|
||||
}
|
||||
|
||||
func (b errorBackend) GetReader(t backend.Type, name string, offset, length uint) (io.ReadCloser, error) {
|
||||
rd, err := b.Backend.GetReader(t, name, offset, length)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user