From aa3c7fc41ae6a864fa8f94675b999455fed85d6e Mon Sep 17 00:00:00 2001 From: David Dworken Date: Thu, 7 Sep 2023 07:57:20 -0700 Subject: [PATCH] Follow up to #103: assign err from fmt.Fprintf to _ to ensure go-errcheck doesn't flag it --- backend/server/server.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/server/server.go b/backend/server/server.go index 9f766b2..499d393 100644 --- a/backend/server/server.go +++ b/backend/server/server.go @@ -153,12 +153,12 @@ func statsHandler(w http.ResponseWriter, r *http.Request) { if err != nil { panic(err) } - fmt.Fprintf(w, "Num devices: %d\n", numDevices) - fmt.Fprintf(w, "Num history entries processed: %d\n", nep.Total) - fmt.Fprintf(w, "Num DB entries: %d\n", numDbEntries) - fmt.Fprintf(w, "Weekly active installs: %d\n", weeklyActiveInstalls) - fmt.Fprintf(w, "Weekly active queries: %d\n", weeklyQueryUsers) - fmt.Fprintf(w, "Last registration: %s\n", lastRegistration) + _, _ = fmt.Fprintf(w, "Num devices: %d\n", numDevices) + _, _ = fmt.Fprintf(w, "Num history entries processed: %d\n", nep.Total) + _, _ = fmt.Fprintf(w, "Num DB entries: %d\n", numDbEntries) + _, _ = fmt.Fprintf(w, "Weekly active installs: %d\n", weeklyActiveInstalls) + _, _ = fmt.Fprintf(w, "Weekly active queries: %d\n", weeklyQueryUsers) + _, _ = fmt.Fprintf(w, "Last registration: %s\n", lastRegistration) } func apiSubmitHandler(w http.ResponseWriter, r *http.Request) { @@ -491,7 +491,7 @@ func getNumConnectionsHandler(w http.ResponseWriter, r *http.Request) { if err != nil { panic(err) } - fmt.Fprintf(w, "%#v", sqlDb.Stats().OpenConnections) + _, _ = fmt.Fprintf(w, "%#v", sqlDb.Stats().OpenConnections) } func isTestEnvironment() bool {