code: func (c *Cluster) GetRegionByKey(key []byte) (*metapb.Region, *metapb.Peer) {
  	c.RLock()
  	defer c.RUnlock()
  
  	for _, r := range c.regions {
  		if regionContains(r.Meta.StartKey, r.Meta.EndKey, key) {
  			return proto.Clone(r.Meta).(*metapb.Region), proto.Clone(r.leaderPeer()).(*metapb.Peer)
  		}
  	}
  	return nil, nil
  }
docs: // GetRegionByKey returns the Region and its leader whose range contains the key.