From ebba233a3a86259e368f9826af269c70d8a27462 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 22 Apr 2023 12:32:57 +0200 Subject: [PATCH] backend/sema: rename constructor to NewBackend --- cmd/restic/global.go | 4 ++-- internal/backend/sema/backend.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 537fe02fe..43b8eb217 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -746,7 +746,7 @@ func open(ctx context.Context, s string, gopts GlobalOptions, opts options.Optio } // wrap with debug logging and connection limiting - be = logger.New(sema.New(be)) + be = logger.New(sema.NewBackend(be)) // wrap backend if a test specified an inner hook if gopts.backendInnerTestHook != nil { @@ -821,5 +821,5 @@ func create(ctx context.Context, s string, opts options.Options) (restic.Backend return nil, err } - return logger.New(sema.New(be)), nil + return logger.New(sema.NewBackend(be)), nil } diff --git a/internal/backend/sema/backend.go b/internal/backend/sema/backend.go index 2294ef0b2..fc4a9dde5 100644 --- a/internal/backend/sema/backend.go +++ b/internal/backend/sema/backend.go @@ -18,8 +18,8 @@ type connectionLimitedBackend struct { sem semaphore } -// New creates a backend that limits the concurrent operations on the underlying backend -func New(be restic.Backend) restic.Backend { +// NewBackend creates a backend that limits the concurrent operations on the underlying backend +func NewBackend(be restic.Backend) restic.Backend { sem, err := newSemaphore(be.Connections()) if err != nil { panic(err)