mirror of
https://github.com/restic/rest-server.git
synced 2026-09-25 21:41:25 -07:00
empty backend type
This commit is contained in:
+1
-4
@@ -79,10 +79,7 @@ func (r *Repository) ReadBlob(bt backend.Type, id backend.ID) (io.ReadSeeker, er
|
|||||||
file := filepath.Join(r.path, string(bt), id.String())
|
file := filepath.Join(r.path, string(bt), id.String())
|
||||||
f, err := os.Open(file)
|
f, err := os.Open(file)
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
if err != nil {
|
return f, err
|
||||||
return f, err
|
|
||||||
}
|
|
||||||
return f, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Repository) WriteBlob(bt backend.Type, id backend.ID, data []byte) error {
|
func (r *Repository) WriteBlob(bt backend.Type, id backend.ID, data []byte) error {
|
||||||
|
|||||||
+2
-2
@@ -50,12 +50,12 @@ func TestBackendType(t *testing.T) {
|
|||||||
var bt backend.Type
|
var bt backend.Type
|
||||||
|
|
||||||
bt = BackendType("/")
|
bt = BackendType("/")
|
||||||
if !bt.IsNull() {
|
if bt != "" {
|
||||||
t.Error("backend type should be nil")
|
t.Error("backend type should be nil")
|
||||||
}
|
}
|
||||||
|
|
||||||
bt = BackendType("/test")
|
bt = BackendType("/test")
|
||||||
if !bt.IsNull() {
|
if bt != "" {
|
||||||
t.Error("backend type should be nil")
|
t.Error("backend type should be nil")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user