package env

import (
	"os"
	"strconv"
)

func GetOrDefault(key string, defaultV string) string {
	if v, ok := os.LookupEnv(key); ok {
		return v
	}
	return defaultV
}

func GetOrDefaultInt(key string, defaultV int) int {
	if v, ok := os.LookupEnv(key); ok {
		if intV, err := strconv.Atoi(v); err != nil {
			return intV
		}
	}
	return defaultV
}
