From 5ae94147a6b6fc9086372486c8bf5d4acb767323 Mon Sep 17 00:00:00 2001 From: Cosmin Tupangiu Date: Wed, 16 Oct 2024 09:36:20 +0200 Subject: [PATCH] agent/fileserver: Fix lint errcheck This commit fix the lint error errcheck when writing the content of the index file into the ResponseWriter is not handled. --- internal/agent/fileserver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/agent/fileserver.go b/internal/agent/fileserver.go index 661842e..900b014 100644 --- a/internal/agent/fileserver.go +++ b/internal/agent/fileserver.go @@ -27,6 +27,8 @@ func handleGetLogin(log *log.PrefixLogger, wwwDir string) http.HandlerFunc { w.Header().Set("Content-Type", "text/html") w.Header().Set("Content-Length", strconv.Itoa(len(file))) - w.Write(file) + if _, err := w.Write(file); err != nil { + log.Warnf("Failed writing the content of %s", pathToIndeHtml) + } } }