From a4e947a356add617b5022c31f6dc28e5b78849fe Mon Sep 17 00:00:00 2001 From: bestgopher <84328409@qq.com> Date: Thu, 16 Apr 2020 22:31:58 +0800 Subject: [PATCH] update:SetMode function (#2321) --- mode.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mode.go b/mode.go index edfc2940..ca3677a9 100644 --- a/mode.go +++ b/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 }