fixed .env loading
This commit is contained in:
parent
87887832c8
commit
65d88f8c27
2 changed files with 3 additions and 1 deletions
|
|
@ -43,7 +43,7 @@ var (
|
||||||
var encryptionKey []byte
|
var encryptionKey []byte
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
godotenv.Load("/home/Jannik/Documents/Code/Go/Untis/Untis-Logger/.env")
|
godotenv.Load(".env")
|
||||||
keyStr := os.Getenv("ENC_KEY")
|
keyStr := os.Getenv("ENC_KEY")
|
||||||
if keyStr == "" {
|
if keyStr == "" {
|
||||||
panic("ENC_KEY environment variable not set")
|
panic("ENC_KEY environment variable not set")
|
||||||
|
|
|
||||||
2
main.go
2
main.go
|
|
@ -34,6 +34,7 @@ type NamedTimetableEntry struct {
|
||||||
|
|
||||||
// init and main//
|
// init and main//
|
||||||
func init() {
|
func init() {
|
||||||
|
godotenv.Load(".env")
|
||||||
err := godotenv.Load()
|
err := godotenv.Load()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error loading .env file: %v", err)
|
log.Printf("Error loading .env file: %v", err)
|
||||||
|
|
@ -51,6 +52,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
godotenv.Load(".env")
|
||||||
//Untis.Main() //starting API calls function| happens in schedule func
|
//Untis.Main() //starting API calls function| happens in schedule func
|
||||||
//Run()
|
//Run()
|
||||||
//Starts logging the timetable for each new Lesson and logs changes
|
//Starts logging the timetable for each new Lesson and logs changes
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue