1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-09-08 17:06:42 +00:00
Files
whiskr/env.go
2025-08-11 01:59:26 +02:00

30 lines
461 B
Go

package main
import (
"errors"
"os"
"github.com/joho/godotenv"
)
var (
Debug bool
NoOpen bool
OpenRouterToken string
)
func init() {
log.MustPanic(godotenv.Load())
Debug = os.Getenv("DEBUG") == "true"
NoOpen = os.Getenv("NO_OPEN") == "true"
if OpenRouterToken = os.Getenv("OPENROUTER_TOKEN"); OpenRouterToken == "" {
log.Panic(errors.New("missing openrouter token"))
}
if Debug {
log.Warning("Debug mode enabled")
}
}