updating getEnv function log (#156)

This commit is contained in:
Tobias Lindberg
2022-03-04 10:10:37 +01:00
committed by GitHub
parent 7bc8a1989d
commit bbed9fb676
+7 -1
View File
@@ -280,11 +280,17 @@ func isNil(i interface{}) bool {
}
return false
}
// isEnvExist func - check if environment var is set
func isEnvExist(key string) (ok bool) {
_, ok = os.LookupEnv(key)
return
}
*/
// getEnv func - read an environment or return a default value
func getEnv(key string, defaultVal string) string {
if value, exists := os.LookupEnv(key); exists {
if value, exists := os.LookupEnv(key); exists && value != "" {
return value
}
return defaultVal