|
package util
|
|
|
|
import "os"
|
|
|
|
const (
|
|
ProjectEnv = "PROJECT_ENV"
|
|
|
|
EnvProduction = "production"
|
|
EnvTest = "test"
|
|
)
|
|
|
|
// 是否生产环境
|
|
func IsEnvProduction() bool {
|
|
return os.Getenv(ProjectEnv) == EnvProduction
|
|
}
|
|
|
|
// 是否测试环境
|
|
func IsEvnTest() bool {
|
|
return os.Getenv(ProjectEnv) == EnvTest
|
|
}
|