Files
scroll/common/utils/env.go
2022-10-19 21:01:35 +08:00

13 lines
229 B
Go

package utils
import "os"
// GetEnvWithDefault get value from env if is none use the default
func GetEnvWithDefault(key string, defult string) string {
val := os.Getenv(key)
if len(val) == 0 {
val = defult
}
return val
}