20 lines
257 B
Go
Raw Normal View History

2022-12-28 11:57:58 -05:00
package env
import (
"fmt"
"os"
"github.com/joho/godotenv"
2022-12-28 11:57:58 -05:00
)
func RunChecks() {
godotenv.Load(".env")
2022-12-28 11:57:58 -05:00
checkEnv("APP_URL")
}
func checkEnv(key string) {
if os.Getenv(key) == "" {
panic(fmt.Sprintf("Environment variable %s is not set", key))
}
}