backend: Unify backend construction using factory and registry
This unified construction removes most backend-specific code from global.go. The backend registry will also enable integration tests to use custom backends if necessary.
This commit is contained in:
parent
56836364a4
commit
7d12c29286
16 changed files with 235 additions and 142 deletions
|
@ -27,7 +27,7 @@ func newTestSuite(t testing.TB) *test.Suite[rclone.Config] {
|
|||
// CreateFn is a function that creates a temporary repository for the tests.
|
||||
Create: func(cfg rclone.Config) (restic.Backend, error) {
|
||||
t.Logf("Create()")
|
||||
be, err := rclone.Create(context.TODO(), cfg)
|
||||
be, err := rclone.Create(context.TODO(), cfg, nil)
|
||||
var e *exec.Error
|
||||
if errors.As(err, &e) && e.Err == exec.ErrNotFound {
|
||||
t.Skipf("program %q not found", e.Name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue