mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2026-11-13 08:37:15 +00:00
refactor: add default env variable value
This commit is contained in:
1 parent
3527b4cdcd
commit
24ccdaa671
2 files changed
+10
-3
No files matched your search
@@ -180,3 +180,10 @@ func GetIntEnv(envName string) int {
|
||||
}
|
||||
return ret
|
||||
}
|
||||
func EnvWithDefault(envName string, defaultValue string) string {
|
||||
value := os.Getenv(envName)
|
||||
if value == "" {
|
||||
return defaultValue
|
||||
}
|
||||
return value
|
||||
}
|
||||
Reference in new issue
Block a user