This repository has been archived on 2025-08-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
web-app-template/utils/env.go
Tim Wundenberg ec0e748e1f
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 45s
chore: extract mail to it's own service
2024-09-27 23:21:37 +02:00

28 lines
405 B
Go

package utils
import (
"log"
"log/slog"
"os"
)
var (
BaseUrl string
Environment string
)
func MustInitEnv() {
BaseUrl = os.Getenv("BASE_URL")
Environment = os.Getenv("ENVIRONMENT")
if BaseUrl == "" {
log.Fatal("BASE_URL must be set")
}
if Environment == "" {
log.Fatal("ENVIRONMENT must be set")
}
slog.Info("BASE_URL is " + BaseUrl)
slog.Info("ENVIRONMENT is " + Environment)
}