chore: make the code more readable, as per review comment

This commit is contained in:
Jose Diaz-Gonzalez 2023-06-03 13:28:41 -04:00 committed by GitHub
parent 814332340d
commit 671c94f23e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,16 +51,19 @@ func debugPrintLoadTemplate(tmpl *template.Template) {
}
func debugPrint(format string, values ...interface{}) {
if IsDebugging() {
if DebugPrintFunc == nil {
if !strings.HasSuffix(format, "\n") {
format += "\n"
}
fmt.Fprintf(DefaultWriter, "[GIN-debug] "+format, values...)
} else {
DebugPrintFunc(format, values...)
}
if !IsDebugging() {
return
}
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) {