Last second clean ups

This commit is contained in:
Abdul Rabbani 2022-04-20 18:23:21 -04:00
parent d7ad4108a7
commit 7a2c4b3cef
3 changed files with 4 additions and 4 deletions

View File

@ -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.

View File

@ -92,6 +92,7 @@ func logFile() {
}
}
// Format the logger
func logFormat() {
logFormat := viper.GetString("log.format")

View File

@ -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: