From f7e5eaae702413ccaa59bb5aae09ea370fb1a894 Mon Sep 17 00:00:00 2001 From: Cory Snider Date: Tue, 24 Oct 2023 16:11:10 -0400 Subject: [PATCH] internal/dcontext: drop GetRequest() function It is no longer used. Signed-off-by: Cory Snider --- internal/dcontext/http.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/internal/dcontext/http.go b/internal/dcontext/http.go index df068f13e..84d5b4744 100644 --- a/internal/dcontext/http.go +++ b/internal/dcontext/http.go @@ -40,16 +40,6 @@ func WithRequest(ctx context.Context, r *http.Request) context.Context { } } -// GetRequest returns the http request in the given context. Returns -// ErrNoRequestContext if the context does not have an http request associated -// with it. -func GetRequest(ctx context.Context) (*http.Request, error) { - if r, ok := ctx.Value("http.request").(*http.Request); r != nil && ok { - return r, nil - } - return nil, ErrNoRequestContext -} - // GetRequestID attempts to resolve the current request id, if possible. An // error is return if it is not available on the context. func GetRequestID(ctx context.Context) string {