config ext

This commit is contained in:
nquidox 2026-04-03 19:06:06 +03:00
parent 25a422c0e6
commit 991b250118
3 changed files with 38 additions and 14 deletions

View file

@ -50,3 +50,14 @@ func getEnvPort(key string, fallback uint16) uint16 {
}
return fallback
}
func getEnvBool(key string, fallback bool) bool {
if value, ok := os.LookupEnv(key); ok {
val, err := strconv.ParseBool(value)
if err != nil {
return fallback
}
return val
}
return fallback
}