1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-09 00:00:02 +01:00

cleanup backend initialization

This commit is contained in:
Michael Eischer 2025-02-07 19:08:51 +01:00
parent c752867f0a
commit d378a171c8

View file

@ -148,11 +148,12 @@ func (opts *GlobalOptions) AddFlags(f *pflag.FlagSet) {
}
var globalOptions = GlobalOptions{
stdout: os.Stdout,
stderr: os.Stderr,
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 {