cleanup backend initialization

This commit is contained in:
Michael Eischer 2025-02-07 19:08:51 +01:00
parent c752867f0a
commit d378a171c8
1 changed files with 5 additions and 4 deletions

View File

@ -150,9 +150,10 @@ func (opts *GlobalOptions) AddFlags(f *pflag.FlagSet) {
var globalOptions = GlobalOptions{
stdout: os.Stdout,
stderr: os.Stderr,
backends: collectBackends(),
}
func init() {
func collectBackends() *location.Registry {
backends := location.NewRegistry()
backends.Register(azure.NewFactory())
backends.Register(b2.NewFactory())
@ -163,7 +164,7 @@ func init() {
backends.Register(s3.NewFactory())
backends.Register(sftp.NewFactory())
backends.Register(swift.NewFactory())
globalOptions.backends = backends
return backends
}
func stdinIsTerminal() bool {