Context.Get() does not need to test whether Keys is nil or not

This commit is contained in:
Maxime Soulé 2016-09-09 11:37:22 +02:00 committed by GitHub
parent f931d1ea80
commit bf8da4a08a
1 changed files with 1 additions and 3 deletions

View File

@ -166,9 +166,7 @@ func (c *Context) Set(key string, value interface{}) {
// Get returns the value for the given key, ie: (value, true).
// If the value does not exists it returns (nil, false)
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
}