code: func (c *Cursor) search(key []byte, pgid pgid) {
  	p, n := c.bucket.pageNode(pgid)
  	if p != nil && (p.flags&(branchPageFlag|leafPageFlag)) == 0 {
  		panic(fmt.Sprintf("invalid page type: %d: %x", p.id, p.flags))
  	}
  	e := elemRef{page: p, node: n}
  	c.stack = append(c.stack, e)
  
  	// If we're on a leaf page/node then find the specific node.
  	if e.isLeaf() {
  		c.nsearch(key)
  		return
  	}
  
  	if n != nil {
  		c.searchNode(key, n)
  		return
  	}
  	c.searchPage(key, p)
  }
docs: // search recursively performs a binary search against a given page/node until it finds a given key.