From 6727bd3769168bacecbb940930e9373710e2065d Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 17 Oct 2024 12:55:47 +0300 Subject: [PATCH] polished code --- cmd/africastalking/main.go | 1 - internal/storage/storageservice.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/africastalking/main.go b/cmd/africastalking/main.go index b810639..c52094a 100644 --- a/cmd/africastalking/main.go +++ b/cmd/africastalking/main.go @@ -29,7 +29,6 @@ var ( ) func init() { - fmt.Println("Running init") initializers.LoadEnvVariables() } diff --git a/internal/storage/storageservice.go b/internal/storage/storageservice.go index d99e0ca..ec2b710 100644 --- a/internal/storage/storageservice.go +++ b/internal/storage/storageservice.go @@ -68,7 +68,7 @@ func (ms *MenuStorageService) GetPersister(ctx context.Context) (*persist.Persis func (ms *MenuStorageService) GetUserdataDb(ctx context.Context) (db.Db, error) { database, ok := ctx.Value("Database").(string) if !ok { - fmt.Println("The database is not set") + return nil, fmt.Errorf("failed to select the database") } if database == "postgres" {