From fcea6145f504cb0802181c300d5cc74147415881 Mon Sep 17 00:00:00 2001 From: Richard Scothern Date: Mon, 18 Jul 2016 13:27:12 -0700 Subject: [PATCH] Fix vet errors with go 1.7 Signed-off-by: Richard Scothern --- context/http.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/context/http.go b/context/http.go index 2cb1d041..7fe9b8ab 100644 --- a/context/http.go +++ b/context/http.go @@ -103,20 +103,22 @@ func GetRequestID(ctx Context) string { // WithResponseWriter returns a new context and response writer that makes // interesting response statistics available within the context. func WithResponseWriter(ctx Context, w http.ResponseWriter) (Context, http.ResponseWriter) { - irw := instrumentedResponseWriter{ - ResponseWriter: w, - Context: ctx, - } - if closeNotifier, ok := w.(http.CloseNotifier); ok { irwCN := &instrumentedResponseWriterCN{ - instrumentedResponseWriter: irw, - CloseNotifier: closeNotifier, + instrumentedResponseWriter: instrumentedResponseWriter{ + ResponseWriter: w, + Context: ctx, + }, + CloseNotifier: closeNotifier, } return irwCN, irwCN } + irw := instrumentedResponseWriter{ + ResponseWriter: w, + Context: ctx, + } return &irw, &irw }