From 88230d5109c8fd5d3fe8274c55e2a544489e60a9 Mon Sep 17 00:00:00 2001 From: Roman Zipp Date: Sun, 23 Jan 2022 16:29:19 +0100 Subject: [PATCH] Fix main app settings variable name collision --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index b9dd294..33cf1f7 100644 --- a/main.go +++ b/main.go @@ -45,22 +45,22 @@ func RegisterPipelineRoutes(r *mux.Router, pipelines []pipelines.IPipeline, stor } func main() { - settings, err := settings.LoadSettings(afero.NewOsFs()) + appSettings, err := settings.LoadSettings(afero.NewOsFs()) if err != nil { panic(err) } var storageProvider storage.IStorageProvider - if settings.StorageProvider.Type == 0 { - storageProvider = storage.GetFileSystemStorageProvider(settings.StorageProvider.BasePath, "") + if appSettings.StorageProvider.Type == 0 { + storageProvider = storage.GetFileSystemStorageProvider(appSettings.StorageProvider.BasePath, "") } else { panic("Invalid file system provided!") } pipes := pipelines.LoadPipelines() - authMiddleware := auth.CreateAuthenticationMiddleware(settings.Token) + authMiddleware := auth.CreateAuthenticationMiddleware(appSettings.Token) r := mux.NewRouter() r.Use(authMiddleware.Middleware) @@ -68,7 +68,7 @@ func main() { RegisterPipelineRoutes(r, pipes, storageProvider) - err = http.ListenAndServe(settings.Endpoint, r) + err = http.ListenAndServe(appSettings.Endpoint, r) if err != nil { panic(err) }