package server type ServerContext struct { values map[interface{}]interface{} } func (c *ServerContext) Value(key interface{}) interface{} { if nil == c.values { return nil } return c.values[key] } func (c *ServerContext) setValue(key interface{}, value interface{}) { if nil == c.values { c.values = make(map[interface{}]interface{}, 1) } c.values[key] = value }