This commit is contained in:
nquidox 2025-10-20 18:23:53 +03:00
commit a72002540d
9 changed files with 133 additions and 0 deletions

24
config/getEnv.go Normal file
View file

@ -0,0 +1,24 @@
package config
import (
"os"
"strconv"
)
func getEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
return fallback
}
func getEnvInt(key string, fallback int) int {
if value, ok := os.LookupEnv(key); ok {
num, err := strconv.Atoi(value)
if err != nil {
return fallback
}
return num
}
return fallback
}