mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
basic root dir pre check on fs storage.New (#199)
* basic root dir pre check on fs storage.New * update uses of fs.storage.New to check for error * use testify to check for error
This commit is contained in:
committed by
Aaron Schlesinger
parent
9e76722acc
commit
5101e1ea6d
@@ -35,7 +35,10 @@ func GetStorage() (storage.BackendConnector, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("missing disk storage root (%s)", err)
|
||||
}
|
||||
s := fs.NewStorage(storageRoot, afero.NewOsFs())
|
||||
s, err := fs.NewStorage(storageRoot, afero.NewOsFs())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create new storage from os fs (%s)", err)
|
||||
}
|
||||
return storage.NoOpBackendConnector(s), nil
|
||||
case "postgres", "sqlite", "cockroach", "mysql":
|
||||
storageRoot, err = envy.MustGet("ATHENS_RDBMS_STORAGE_NAME")
|
||||
|
||||
Reference in New Issue
Block a user