+
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func SetMode(value string) {
}

Copy link

Copilot AI Jul 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding input validation or documentation to ensure that empty string values are indeed impossible. If this assumption changes in the future, removing this case could introduce bugs where empty strings fall through to an unhandled case.

Suggested change
if !isValidMode(value) {
panic("gin mode unknown: " + value + " (available modes: debug, release, test)")
}

Copilot uses AI. Check for mistakes.

switch value {
case DebugMode, "":
case DebugMode:
atomic.StoreInt32(&ginMode, debugCode)
case ReleaseMode:
atomic.StoreInt32(&ginMode, releaseCode)
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载