Browse Source

bug: wrong parameter order, `ok` not needed

Gwyneth Llewelyn 5 months ago
parent
commit
d99b113a7f
1 changed files with 3 additions and 3 deletions
  1. 3 3
      functions.go

+ 3 - 3
functions.go

@@ -29,7 +29,7 @@ func checkErrPanic(err error) {
 func checkErr(err error) {
 	if err != nil {
 		if pc, file, line, ok := runtime.Caller(1); ok {
-			log.Errorf("%s:%d (%v) - error: %v\n", filepath.Base(file), line, pc, ok, err)
+			log.Errorf("%s:%d (%v) - error: %v\n", filepath.Base(file), line, pc, err)
 			return
 		}
 		log.Panic(err)
@@ -43,7 +43,7 @@ func checkErrHTTP(w http.ResponseWriter, httpStatus int, errorMessage string, er
 	if err != nil {
 		http.Error(w, fmt.Sprintf(errorMessage, err), httpStatus)
 		if pc, file, line, ok := runtime.Caller(1); ok {
-			log.Error("(", http.StatusText(httpStatus), ") ", filepath.Base(file), ":", line, ":", pc, ok, " - error:", errorMessage, err)
+			log.Error("(", http.StatusText(httpStatus), ") ", filepath.Base(file), ":", line, ":", pc, " - error:", errorMessage, err)
 			return
 		}
 		log.Error("(", http.StatusText(httpStatus), ") ", errorMessage, err)
@@ -55,7 +55,7 @@ func checkErrPanicHTTP(w http.ResponseWriter, httpStatus int, errorMessage strin
 	if err != nil {
 		http.Error(w, fmt.Sprintf(errorMessage, err), httpStatus)
 		if pc, file, line, ok := runtime.Caller(1); ok {
-			log.Panic("(", http.StatusText(httpStatus), ") ", filepath.Base(file), ":", line, ":", pc, ok, " - panic:", errorMessage, err)
+			log.Panic("(", http.StatusText(httpStatus), ") ", filepath.Base(file), ":", line, ":", pc, " - panic:", errorMessage, err)
 			return
 		}
 		log.Panic("(", http.StatusText(httpStatus), ") ", errorMessage, err)