1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-09-09 01:09:54 +00:00
Files
whiskr/env.go

28 lines
396 B
Go
Raw Normal View History

2025-08-05 03:56:23 +02:00
package main
import (
"errors"
"os"
"github.com/joho/godotenv"
)
2025-08-11 01:16:52 +02:00
var (
Debug bool
OpenRouterToken string
)
2025-08-05 03:56:23 +02:00
func init() {
log.MustPanic(godotenv.Load())
2025-08-11 01:16:52 +02:00
Debug = os.Getenv("DEBUG") == "true"
2025-08-05 03:56:23 +02:00
if OpenRouterToken = os.Getenv("OPENROUTER_TOKEN"); OpenRouterToken == "" {
log.Panic(errors.New("missing openrouter token"))
}
2025-08-11 01:16:52 +02:00
if Debug {
log.Debug("Debug mode enabled")
}
2025-08-05 03:56:23 +02:00
}