From 65d88f8c27ef51c30f611d639338cff7fa05dea0 Mon Sep 17 00:00:00 2001 From: Jannover5000r <90698896+Jannover5000r@users.noreply.github.com> Date: Tue, 26 Aug 2025 01:47:23 +0200 Subject: [PATCH] fixed .env loading --- Botrun/BotStart.go | 2 +- main.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Botrun/BotStart.go b/Botrun/BotStart.go index d3e0571..63a5c6d 100644 --- a/Botrun/BotStart.go +++ b/Botrun/BotStart.go @@ -43,7 +43,7 @@ var ( var encryptionKey []byte func init() { - godotenv.Load("/home/Jannik/Documents/Code/Go/Untis/Untis-Logger/.env") + godotenv.Load(".env") keyStr := os.Getenv("ENC_KEY") if keyStr == "" { panic("ENC_KEY environment variable not set") diff --git a/main.go b/main.go index 23c721d..3751813 100644 --- a/main.go +++ b/main.go @@ -34,6 +34,7 @@ type NamedTimetableEntry struct { // init and main// func init() { + godotenv.Load(".env") err := godotenv.Load() if err != nil { log.Printf("Error loading .env file: %v", err) @@ -51,6 +52,7 @@ func init() { } func main() { + godotenv.Load(".env") //Untis.Main() //starting API calls function| happens in schedule func //Run() //Starts logging the timetable for each new Lesson and logs changes