From ba860a542789644b58998286a674da5e44d0a91b Mon Sep 17 00:00:00 2001 From: liverday Date: Fri, 31 Mar 2023 18:10:27 -0300 Subject: [PATCH] feat: godotenv only on dev --- main.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 8a8ffa5..8d75bda 100644 --- a/main.go +++ b/main.go @@ -156,10 +156,14 @@ func start() { } func main() { - err := godotenv.Load() + env := os.Getenv("ENVIRONMENT") - if err != nil { - log.Fatal("Error loading .env file") + if env != "PRODUCTION" { + err := godotenv.Load() + + if err != nil { + log.Fatal("Error loading .env file") + } } config, err := config.Load()