From 8606328379e7021a2e4bf0d56c0602fa595fa72e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 28 Jun 2024 21:11:56 +0200 Subject: remove unnecessary assignments --- internal/server/logging.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/server/logging.go') diff --git a/internal/server/logging.go b/internal/server/logging.go index 5d607bb..7df35d7 100644 --- a/internal/server/logging.go +++ b/internal/server/logging.go @@ -24,18 +24,16 @@ func NewLoggingResponseWriter(w http.ResponseWriter) *LoggingResponseWriter { func wrapHandlerWithLogging(wrappedHandler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - host := r.Host lw := NewLoggingResponseWriter(w) wrappedHandler.ServeHTTP(lw, r) if r.URL.Path == "/health" { return } - statusCode := lw.statusCode log.Info( "http request", "method", r.Method, - "status", statusCode, - "host", host, + "status", lw.statusCode, + "host", r.Host, "path", r.URL.Path, "location", lw.Header().Get("Location"), ) -- cgit 1.4.1