Compare commits

..

No commits in common. "4ec50cee8a6d1c65483710a2e559056fe2d3bb9e" and "5fb0764630adad749bd8353ce56668ec7357144d" have entirely different histories.

2 changed files with 4 additions and 18 deletions

View File

@ -2,7 +2,6 @@ package main
import (
"log"
"os"
"legalgo-BE-go/config"
"legalgo-BE-go/database"
@ -13,14 +12,8 @@ import (
)
func main() {
// Check if the .env file exists
if _, err := os.Stat(".env"); err == nil {
// Load environment variables from .env file if it exists
if err := godotenv.Load(); err != nil {
log.Println("Error loading .env file, continuing without it")
}
} else {
log.Println(".env file not found, skipping load")
if err := godotenv.Load(); err != nil {
log.Fatal("cannot load environment file")
}
config.InitEnv()

View File

@ -4,7 +4,6 @@ import (
"context"
"fmt"
"log"
"os"
"legalgo-BE-go/config"
"legalgo-BE-go/database"
@ -19,14 +18,8 @@ import (
)
func init() {
// Check if the .env file exists
if _, err := os.Stat(".env"); err == nil {
// Load environment variables from .env file if it exists
if err := godotenv.Load(); err != nil {
log.Println("Error loading .env file, continuing without it")
}
} else {
log.Println(".env file not found, skipping load")
if err := godotenv.Load(); err != nil {
log.Fatal("cannot load environment file")
}
config.InitEnv()