Remove duplicate check

This commit is contained in:
MaxJa4 2023-08-21 09:45:36 +02:00
parent 4e04cb9926
commit 6362b322c2

View File

@ -2,7 +2,6 @@ package dropbox
import ( import (
"bytes" "bytes"
"errors"
"fmt" "fmt"
"os" "os"
"path" "path"
@ -29,9 +28,6 @@ type Config struct {
// NewStorageBackend creates and initializes a new Dropbox storage backend. // NewStorageBackend creates and initializes a new Dropbox storage backend.
func NewStorageBackend(opts Config, logFunc storage.Log) (storage.Backend, error) { func NewStorageBackend(opts Config, logFunc storage.Log) (storage.Backend, error) {
if opts.Token == "" {
return nil, errors.New("NewStorageBackend: No Dropbox token has been provided")
} else {
config := dropbox.Config{ config := dropbox.Config{
Token: opts.Token, Token: opts.Token,
} }
@ -45,7 +41,6 @@ func NewStorageBackend(opts Config, logFunc storage.Log) (storage.Backend, error
}, },
client: client, client: client,
}, nil }, nil
}
} }
// Name returns the name of the storage backend // Name returns the name of the storage backend