mirror of
https://github.com/kairos-io/osbuilder.git
synced 2025-09-27 14:43:11 +00:00
15 lines
264 B
Go
15 lines
264 B
Go
![]() |
package helpers
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
// GetEnv - Lookup the environment variable provided and set to default value if variable isn't found
|
||
|
func GetEnv(key, fallback string) string {
|
||
|
if value := os.Getenv(key); len(value) > 0 {
|
||
|
return value
|
||
|
}
|
||
|
|
||
|
return fallback
|
||
|
}
|