forked from mirror/gin
update:SetMode function (#2321)
This commit is contained in:
parent
4f208887e1
commit
a4e947a356
10
mode.go
10
mode.go
|
@ -50,8 +50,12 @@ func init() {
|
|||
|
||||
// SetMode sets gin mode according to input string.
|
||||
func SetMode(value string) {
|
||||
if value == "" {
|
||||
value = DebugMode
|
||||
}
|
||||
|
||||
switch value {
|
||||
case DebugMode, "":
|
||||
case DebugMode:
|
||||
ginMode = debugCode
|
||||
case ReleaseMode:
|
||||
ginMode = releaseCode
|
||||
|
@ -60,9 +64,7 @@ func SetMode(value string) {
|
|||
default:
|
||||
panic("gin mode unknown: " + value)
|
||||
}
|
||||
if value == "" {
|
||||
value = DebugMode
|
||||
}
|
||||
|
||||
modeName = value
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue