ignore env file

This commit is contained in:
2024-12-08 16:07:36 +01:00
parent d5aae3a8cf
commit 033e596c21

View File

@@ -2,6 +2,7 @@ package main
import (
"fmt"
"log"
"os"
"github.com/joho/godotenv"
@@ -11,12 +12,12 @@ func main() {
if value := os.Getenv("ENV"); value == "prod" {
if ok := godotenv.Load(".env"); ok != nil {
panic(".env not found")
log.Println(".env not found")
}
} else {
fmt.Println("Fallback to dev.env")
if ok := godotenv.Load("dev.env"); ok != nil {
panic("dev.env not found")
log.Println("dev.env not found, falling back to ENVIORMENT VARS")
}
}