You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
238 B
Go
14 lines
238 B
Go
4 months ago
|
package common
|
||
|
|
||
|
import "os"
|
||
|
|
||
|
// GetenvDefault retrieves an environment variable if set, or a provided default
|
||
|
func GetenvDefault(key string, d string) string {
|
||
|
val, ok := os.LookupEnv(key)
|
||
|
if ok {
|
||
|
return val
|
||
|
} else {
|
||
|
return d
|
||
|
}
|
||
|
}
|