From 7a2c4b3cefcab51450ccf517d13e9c20cbf861fc Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Wed, 20 Apr 2022 18:23:21 -0400 Subject: [PATCH] Last second clean ups --- README.md | 2 ++ cmd/root.go | 1 + pkg/database/sql/postgres/database.go | 5 +---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1025ccc..a63cac9 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ a := 1 + 2 log.Info("1 + 2 successfully Added, outcome is: ", a) ``` +- `loghelper.LogError(err)` is a pretty wrapper to output errors. + ## Boot The boot package in `internal` is utilized to start the application. Everything in the boot process must complete successfully for the application to start. If it does not, the application will not start. diff --git a/cmd/root.go b/cmd/root.go index b06c224..860dc78 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -92,6 +92,7 @@ func logFile() { } } +// Format the logger func logFormat() { logFormat := viper.GetString("log.format") diff --git a/pkg/database/sql/postgres/database.go b/pkg/database/sql/postgres/database.go index d79821a..a28d2ad 100644 --- a/pkg/database/sql/postgres/database.go +++ b/pkg/database/sql/postgres/database.go @@ -10,10 +10,6 @@ import ( var _ sql.Database = &DB{} -// TODO: Make NewPostgresDB accept a string and Config. IT should -// Create a driver of its own. -// This will make sure that if you want a driver, it conforms to the interface. - // NewPostgresDB returns a postgres.DB using the provided Config and driver type. func NewPostgresDB(c Config) (*DB, error) { var driver *pgxDriver @@ -27,6 +23,7 @@ func NewPostgresDB(c Config) (*DB, error) { return &DB{driver}, nil } +// Create a driver based on the config func createDriver(c Config) (*pgxDriver, error) { switch c.Driver { case PGX: