13 lines
172 B
Go
13 lines
172 B
Go
|
package bgm
|
||
|
|
||
|
import "os"
|
||
|
|
||
|
func GetEnvDefault(key, defVal string) string {
|
||
|
val, ex := os.LookupEnv(key)
|
||
|
if !ex {
|
||
|
os.Setenv(key, defVal)
|
||
|
return defVal
|
||
|
}
|
||
|
return val
|
||
|
}
|