mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-05-04 20:30:38 +00:00
feat!: run checks on env variables
This commit is contained in:
parent
d664899ab6
commit
d76aa4ca11
2 changed files with 19 additions and 0 deletions
16
env/checks.go
vendored
Normal file
16
env/checks.go
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
package env
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func RunChecks() {
|
||||
checkEnv("APP_URL")
|
||||
}
|
||||
|
||||
func checkEnv(key string) {
|
||||
if os.Getenv(key) == "" {
|
||||
panic(fmt.Sprintf("Environment variable %s is not set", key))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue