Skip to content

Commit

Permalink
feat: godotenv only on dev
Browse files Browse the repository at this point in the history
  • Loading branch information
liverday committed Mar 31, 2023
1 parent c7b4f8f commit ba860a5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ba860a5

Please sign in to comment.