Merge pull request #701 from maxatome/patch-1

Context.Get() does not need to test whether Keys is nil or not
This commit is contained in:
Javier Provecho Fernandez 2016-12-06 20:39:01 +01:00 committed by GitHub
commit 2cab17ba50

View File

@ -163,9 +163,7 @@ func (c *Context) Set(key string, value interface{}) {
// Get returns the value for the given key, ie: (value, true). // Get returns the value for the given key, ie: (value, true).
// If the value does not exists it returns (nil, false) // If the value does not exists it returns (nil, false)
func (c *Context) Get(key string) (value interface{}, exists bool) { func (c *Context) Get(key string) (value interface{}, exists bool) {
if c.Keys != nil {
value, exists = c.Keys[key] value, exists = c.Keys[key]
}
return return
} }