mirror of
https://github.com/jsiebens/ionscale.git
synced 2026-03-31 15:07:49 +01:00
5ad89ff02f
Signed-off-by: Johan Siebens <johan.siebens@gmail.com>
23 lines
321 B
Go
23 lines
321 B
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
func GetBool(key string, defaultValue bool) bool {
|
|
v := os.Getenv(key)
|
|
if len(v) > 0 {
|
|
return strings.ToLower(v) == "true"
|
|
}
|
|
return defaultValue
|
|
}
|
|
|
|
func GetString(key, defaultValue string) string {
|
|
v := os.Getenv(key)
|
|
if v != "" {
|
|
return v
|
|
}
|
|
return defaultValue
|
|
}
|