mirror of
https://github.com/restic/rest-server.git
synced 2025-10-19 07:33:21 +00:00
empty backend type
This commit is contained in:
parent
65767fc061
commit
e69d5b7615
2 changed files with 3 additions and 6 deletions
|
@ -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())
|
||||
f, err := os.Open(file)
|
||||
defer f.Close()
|
||||
if err != nil {
|
||||
return f, err
|
||||
}
|
||||
return f, nil
|
||||
return f, err
|
||||
}
|
||||
|
||||
func (r *Repository) WriteBlob(bt backend.Type, id backend.ID, data []byte) error {
|
||||
|
|
|
@ -50,12 +50,12 @@ func TestBackendType(t *testing.T) {
|
|||
var bt backend.Type
|
||||
|
||||
bt = BackendType("/")
|
||||
if !bt.IsNull() {
|
||||
if bt != "" {
|
||||
t.Error("backend type should be nil")
|
||||
}
|
||||
|
||||
bt = BackendType("/test")
|
||||
if !bt.IsNull() {
|
||||
if bt != "" {
|
||||
t.Error("backend type should be nil")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue