2024-01-16 00:36:49 +01:00
|
|
|
package initializers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
2024-02-28 09:13:08 +01:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/joho/godotenv"
|
2024-01-16 00:36:49 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func LoadEnv() {
|
2024-02-28 09:13:08 +01:00
|
|
|
if os.Getenv("GIN_MODE") != "release" {
|
|
|
|
err := godotenv.Load()
|
2024-01-16 00:36:49 +01:00
|
|
|
|
2024-02-28 09:13:08 +01:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal("Error loading .env file!")
|
|
|
|
}
|
2024-01-16 00:36:49 +01:00
|
|
|
}
|
|
|
|
}
|