mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 05:16:35 +08:00
chore: make the code more readable, as per review comment
This commit is contained in:
parent
814332340d
commit
671c94f23e
21
debug.go
21
debug.go
@ -51,16 +51,19 @@ func debugPrintLoadTemplate(tmpl *template.Template) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func debugPrint(format string, values ...interface{}) {
|
func debugPrint(format string, values ...interface{}) {
|
||||||
if IsDebugging() {
|
if !IsDebugging() {
|
||||||
if DebugPrintFunc == nil {
|
return
|
||||||
if !strings.HasSuffix(format, "\n") {
|
|
||||||
format += "\n"
|
|
||||||
}
|
|
||||||
fmt.Fprintf(DefaultWriter, "[GIN-debug] "+format, values...)
|
|
||||||
} else {
|
|
||||||
DebugPrintFunc(format, values...)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if DebugPrintFunc != nil {
|
||||||
|
DebugPrintFunc(format, values...)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if !strings.HasSuffix(format, "\n") {
|
||||||
|
format += "\n"
|
||||||
|
}
|
||||||
|
fmt.Fprintf(DefaultWriter, "[GIN-debug] "+format, values...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getMinVer(v string) (uint64, error) {
|
func getMinVer(v string) (uint64, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user