service/vendor/bizcommon/util/env.go

21 lines
312 B
Go
Raw Normal View History

2023-12-21 22:17:40 +08:00
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
}