package
Version:
v1.1.7
Opens a new window with list of versions in this module.
Published: Jan 10, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 12
Opens a new window with list of known importers.
README
¶
配置模块
该包用于接管全局公共配置类的一些相关操作,统一管理
环境变量
export GO_ENV=dev
示例
- 获取当前环境的运行模式:
env.GetMode()
- 判断是否为开发模式:
env.IsDevMode()
- 判断是否为测试模式:
env.IsTestMode()
- 判断是否预发布模式:
env.IsReleaseMode()
- 判断是否生产环境:
env.IsProdMode()
Documentation
¶
View Source
const (
EnvName = "GO_ENV"
DevMode = "dev"
TestMode = "test"
ReleaseMode = "release"
ProdMode = "prod"
)
func IsReleaseMode() bool
判断是否预发布模式
Source Files
¶
Click to show internal directories.
Click to hide internal directories.