diff --git a/internal/app/app.go b/internal/app/app.go index cc70e8e..fe98de2 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -18,7 +18,7 @@ var ( ) func Run() { - context, err := createAppContext() + context, err := newAppContext() if err != nil { logErrorAndExit(err, 1) } @@ -33,7 +33,7 @@ func Run() { logErrorAndExit(err, 3) } - categories, err := getAllCategoriesFromServer(context) + categories, err := getAllCategoriesFromServer(context.piwigo) if err != nil { logErrorAndExit(err, 4) } diff --git a/internal/app/appContext.go b/internal/app/appContext.go index fc6c988..c66acd1 100644 --- a/internal/app/appContext.go +++ b/internal/app/appContext.go @@ -43,7 +43,7 @@ func (c *appContext) UsePiwigo(url string, user string, password string) error { return c.piwigo.Initialize(*piwigoUrl, *piwigoUser, *piwigoPassword, *piwigoUploadChunkSizeInKB) } -func createAppContext() (*appContext, error) { +func newAppContext() (*appContext, error) { logrus.Infoln("Preparing application context and configuration") context := new(appContext) diff --git a/internal/app/category.go b/internal/app/category.go index 87c54dd..65b376b 100644 --- a/internal/app/category.go +++ b/internal/app/category.go @@ -10,9 +10,9 @@ import ( "sort" ) -func getAllCategoriesFromServer(context *appContext) (map[string]*piwigo.PiwigoCategory, error) { +func getAllCategoriesFromServer(piwigoApi piwigo.PiwigoCategoryApi) (map[string]*piwigo.PiwigoCategory, error) { logrus.Debugln("Starting GetAllCategories") - categories, err := context.piwigo.GetAllCategories() + categories, err := piwigoApi.GetAllCategories() return categories, err }