From a914d6a3289db7b3d483c6ef030c6296a87086a3 Mon Sep 17 00:00:00 2001 From: nikurasu Date: Sun, 25 Feb 2024 19:23:55 +0100 Subject: [PATCH] fix(error-handling): Handle the .env not found error Dont panic at that error --- src/.env.test | 6 ++++++ src/config/environment.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/.env.test diff --git a/src/.env.test b/src/.env.test new file mode 100644 index 0000000..84fa7aa --- /dev/null +++ b/src/.env.test @@ -0,0 +1,6 @@ +DOMAIN="reg.ulmer-furs.de" +API_KEY="NeedForEep" +DEBUG="true" +DATABASE_PATH="/home/tamaki/Documents/coding/pretix-proxy/main.db" +API_KEY_PRETIX="ktb7ahh2dzkultyk2vqkafkd7s06fj25lie55a9tx9g2is682an55v1wx8zsh4ij" +SECRET="dfdsfdsfdsfsdfsf" \ No newline at end of file diff --git a/src/config/environment.go b/src/config/environment.go index 24bf85d..bfbf7f8 100644 --- a/src/config/environment.go +++ b/src/config/environment.go @@ -13,7 +13,7 @@ var Env entities.Environment func LoadEnv() { err := godotenv.Load() if err != nil { - log.Fatalf("unable to load .env file: %e", err) + log.Printf("unable to load .env file: %e", err) } err = env.Parse(&Env) if err != nil {