From c327833314fafd4accb9bbfbaf01f0dbee7a9a10 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 25 Aug 2018 09:50:43 -0700 Subject: Simplify context keys --- http/context/context.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'http') diff --git a/http/context/context.go b/http/context/context.go index 1c65e64..7a434b5 100644 --- a/http/context/context.go +++ b/http/context/context.go @@ -92,7 +92,7 @@ func (c *Context) PocketRequestToken() string { return c.getContextStringValue(middleware.PocketRequestTokenContextKey) } -func (c *Context) getContextStringValue(key *middleware.ContextKey) string { +func (c *Context) getContextStringValue(key middleware.ContextKey) string { if v := c.request.Context().Value(key); v != nil { return v.(string) } @@ -100,7 +100,7 @@ func (c *Context) getContextStringValue(key *middleware.ContextKey) string { return "" } -func (c *Context) getContextBoolValue(key *middleware.ContextKey) bool { +func (c *Context) getContextBoolValue(key middleware.ContextKey) bool { if v := c.request.Context().Value(key); v != nil { return v.(bool) } @@ -108,7 +108,7 @@ func (c *Context) getContextBoolValue(key *middleware.ContextKey) bool { return false } -func (c *Context) getContextIntValue(key *middleware.ContextKey) int64 { +func (c *Context) getContextIntValue(key middleware.ContextKey) int64 { if v := c.request.Context().Value(key); v != nil { return v.(int64) } -- cgit v1.2.3