log enabled dep

This commit is contained in:
nquidox 2026-04-08 12:15:24 +03:00
parent c5013c03ff
commit b29e60b712
6 changed files with 39 additions and 21 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
}