only load .env file when not in prod

This commit is contained in:
jc 2024-02-24 23:20:19 -05:00
commit 0f95094014
No known key found for this signature in database

View file

@ -19,10 +19,12 @@ type TemplateRenderer struct {
func main() { func main() {
// Load connection string from .env file // Load connection string from .env file
if os.Getenv("GO_ENV") != "production" {
err := godotenv.Load() err := godotenv.Load()
if err != nil { if err != nil {
log.Fatal("failed to load env", err) log.Fatal("failed to load env", err)
} }
}
templates, err := template.New("").ParseGlob("public/views/*.html") templates, err := template.New("").ParseGlob("public/views/*.html")
if err != nil { if err != nil {