LoadEnv will read your .env file(s) and load them into ENV for this process.
(filenames ...string)
| 10 | |
| 11 | // LoadEnv will read your .env file(s) and load them into ENV for this process. |
| 12 | func LoadEnv(filenames ...string) { |
| 13 | err := godotenv.Load(filenames...) |
| 14 | if err != nil { |
| 15 | log.Fatalf("Fatal: cannot load .env file: %v", err) |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | func getEnvWithDefault(key, defaultValue string) string { |
| 20 | value := os.Getenv(key) |