mirror of
https://github.com/tobiasehlert/teslamateapi.git
synced 2026-02-27 09:54:18 +08:00
updating getEnv function log (#156)
This commit is contained in:
+7
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user