From 5f8f21732cd06f05ab3bc02c9500872b05c51796 Mon Sep 17 00:00:00 2001 From: Jannover5000r <90698896+Jannover5000r@users.noreply.github.com> Date: Mon, 24 Aug 2026 03:09:29 +0200 Subject: [PATCH] fix 2 --- Untis/Untis.go | 12 ------------ main.go | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Untis/Untis.go b/Untis/Untis.go index 51fe035..01f6324 100644 --- a/Untis/Untis.go +++ b/Untis/Untis.go @@ -7,7 +7,6 @@ import ( "log" "net/http" "os" - "time" "github.com/joho/godotenv" ) @@ -33,17 +32,6 @@ type LoginResponse struct { var Url = os.Getenv("URL") -var location *time.Location - -func init() { - godotenv.Load("../.env") - locEnv := os.Getenv("LOCATION_ENV") - if locEnv == "" { - locEnv = "UTC" - } - location, _ = time.LoadLocation(locEnv) -} - // var Password = os.Getenv("UNTIS_PASSWORD") // var USERS = os.Getenv("UNTIS_USER") func Main(user, password, userID string) { diff --git a/main.go b/main.go index 0fe0690..5b85c9e 100644 --- a/main.go +++ b/main.go @@ -104,7 +104,7 @@ func init() { locEnv := os.Getenv("LOCATION_ENV") var locerr error Untis.Location, locerr = time.LoadLocation(locEnv) - if err != nil { + if locerr != nil { log.Fatalf("Failed to load Timezone: %v", locerr) } }