From 1137cb2c04c5bfbcb0e1848c84586ec2ed33197a Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:40:46 +0000 Subject: [PATCH] Correct the use of return --- logserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logserver.go b/logserver.go index 4261151..5f10d32 100644 --- a/logserver.go +++ b/logserver.go @@ -84,6 +84,7 @@ func serveFile(w http.ResponseWriter, r *http.Request, path string) { // if it's a directory, serve a listing or a tarball if d.IsDir() { serveDirectory(w, r, path) + return } // if it's a gzipped log file, serve it as text @@ -140,7 +141,6 @@ func serveDirectory(w http.ResponseWriter, r *http.Request, path string) { } log.Println("Serving directory listing of", path) http.ServeFile(w, r, path) - return } // Streams a dynamically created tar.gz file with the contents of the given directory