From 3b4e96509b4f633fad7ae45e014dbf3d1c2895ce Mon Sep 17 00:00:00 2001 From: Nils Date: Sun, 29 May 2022 15:09:58 +0200 Subject: [PATCH] explicitly dont handle returns in certain places --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index d1b3e39..1614ad1 100644 --- a/main.go +++ b/main.go @@ -175,7 +175,7 @@ func ping(w http.ResponseWriter, req *http.Request) { if strings.TrimSpace(res) == "" { http.Error(w, "500: Internal Server Error", http.StatusInternalServerError) } else { - fmt.Fprint(w, strings.TrimSpace(res), "\n") + _, _ = fmt.Fprint(w, strings.TrimSpace(res), "\n") } } @@ -191,7 +191,7 @@ func mtr(w http.ResponseWriter, req *http.Request) { if strings.TrimSpace(res) == "" { http.Error(w, "500: Internal Server Error", http.StatusInternalServerError) } else { - fmt.Fprint(w, strings.TrimSpace(res), "\n") + _, _ = fmt.Fprint(w, strings.TrimSpace(res), "\n") } } @@ -207,7 +207,7 @@ func traceroute(w http.ResponseWriter, req *http.Request) { if strings.TrimSpace(res) == "" { http.Error(w, "500: Internal Server Error", http.StatusInternalServerError) } else { - fmt.Fprint(w, strings.TrimSpace(res), "\n") + _, _ = fmt.Fprint(w, strings.TrimSpace(res), "\n") } } @@ -223,7 +223,7 @@ func nping(w http.ResponseWriter, req *http.Request) { if strings.TrimSpace(res) == "" { http.Error(w, "500: Internal Server Error", http.StatusInternalServerError) } else { - fmt.Fprint(w, strings.TrimSpace(res), "\n") + _, _ = fmt.Fprint(w, strings.TrimSpace(res), "\n") } } @@ -235,5 +235,5 @@ func main() { http.HandleFunc("/nping/", nping) logstdout.Info("Serving on :", listenport) logfile.Info("Serving on :", listenport) - http.ListenAndServe(fmt.Sprint(":", listenport), nil) + _ = http.ListenAndServe(fmt.Sprint(":", listenport), nil) }