optimize code and reduce code cyclomatic complexity (#2737)

* optimize code and reduce code cyclomatic complexity

* optimize if-condtion

Co-authored-by: thinkerou <thinkerou@gmail.com>
This commit is contained in:
tyltr
2021-06-03 20:12:51 +08:00
committed by GitHub
parent 97a32b1de3
commit 34ce2104ca
2 changed files with 4 additions and 8 deletions

View File

@ -95,9 +95,7 @@ at initialization. ie. before any route is registered or the router is listening
}
func debugPrintError(err error) {
if err != nil {
if IsDebugging() {
fmt.Fprintf(DefaultErrorWriter, "[GIN-debug] [ERROR] %v\n", err)
}
if err != nil && IsDebugging() {
fmt.Fprintf(DefaultErrorWriter, "[GIN-debug] [ERROR] %v\n", err)
}
}