|
|
|
@ -27,9 +27,9 @@ func RootDir() string {
|
|
|
|
|
return rootDir
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewConfig(isProd bool) *Config {
|
|
|
|
|
if !isProd {
|
|
|
|
|
err := godotenv.Load(RootDir() + "/.env")
|
|
|
|
|
func NewConfig(envFilePath string) *Config {
|
|
|
|
|
if envFilePath != "" {
|
|
|
|
|
err := godotenv.Load(envFilePath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatalf("environment variable ENV is empty and an error occurred while loading the .env file\n")
|
|
|
|
|
}
|
|
|
|
|