dotenv is hell
This commit is contained in:
parent
2e7cb5af57
commit
256cff93bc
1 changed files with 7 additions and 2 deletions
9
main.go
9
main.go
|
@ -24,8 +24,13 @@ var PublicFS embed.FS
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Load environment variables
|
// Load environment variables
|
||||||
if err := godotenv.Load(".env"); err != nil {
|
err := godotenv.Load(".env")
|
||||||
log.Fatal("Error loading .env file")
|
if err != nil {
|
||||||
|
// If loading .env fails, try loading stack.env
|
||||||
|
err = godotenv.Load("stack.env")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal("Error loading environment file")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize the database connection pool
|
// Initialize the database connection pool
|
||||||
|
|
Loading…
Add table
Reference in a new issue