forked from mirror/gin
simple code and increase coverage (#1174)
This commit is contained in:
parent
1f377cb847
commit
7e5aff8ea7
8
mode.go
8
mode.go
|
@ -39,16 +39,12 @@ var modeName = DebugMode
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
mode := os.Getenv(ENV_GIN_MODE)
|
mode := os.Getenv(ENV_GIN_MODE)
|
||||||
if mode == "" {
|
SetMode(mode)
|
||||||
SetMode(DebugMode)
|
|
||||||
} else {
|
|
||||||
SetMode(mode)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetMode(value string) {
|
func SetMode(value string) {
|
||||||
switch value {
|
switch value {
|
||||||
case DebugMode:
|
case DebugMode, "":
|
||||||
ginMode = debugCode
|
ginMode = debugCode
|
||||||
case ReleaseMode:
|
case ReleaseMode:
|
||||||
ginMode = releaseCode
|
ginMode = releaseCode
|
||||||
|
|
Loading…
Reference in New Issue