Skip to content

Commit

Permalink
update:SetMode function (#2321)
Browse files Browse the repository at this point in the history
  • Loading branch information
bestgopher committed Apr 16, 2020
1 parent 4f20888 commit a4e947a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mode.go
Expand Up @@ -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
Expand All @@ -60,9 +64,7 @@ func SetMode(value string) {
default:
panic("gin mode unknown: " + value)
}
if value == "" {
value = DebugMode
}

modeName = value
}

Expand Down

0 comments on commit a4e947a

Please sign in to comment.