2022-12-29 12:22:59 -05:00

20 lines
257 B
Go

package env
import (
"fmt"
"os"
"github.com/joho/godotenv"
)
func RunChecks() {
godotenv.Load(".env")
checkEnv("APP_URL")
}
func checkEnv(key string) {
if os.Getenv(key) == "" {
panic(fmt.Sprintf("Environment variable %s is not set", key))
}
}