code: func (iter *Iter) advance(wantDescend bool) (noder.Path, error) {
  	current, err := iter.current()
  	if err != nil {
  		return nil, err
  	}
  
  	// The first time we just return the current node.
  	if !iter.hasStarted {
  		iter.hasStarted = true
  		return current, nil
  	}
  
  	// Advances means getting a next current node, either its first child or
  	// its next sibling, depending if we must descend or not.
  	numChildren, err := current.NumChildren()
  	if err != nil {
  		return nil, err
  	}
  
  	mustDescend := numChildren != 0 && wantDescend
  	if mustDescend {
  		// descend: add a new frame with the current's children.
  		frame, err := frame.New(current)
  		if err != nil {
  			return nil, err
  		}
  		iter.push(frame)
  	} else {
  		// don't descend: just drop the current node
  		iter.drop()
  	}
  
  	return iter.current()
  }
docs: // Advances the iterator in the desired direction: descend or
  // dontDescend.
  //
  // Returns the new current element and a nil error on success.  If there
  // are no more elements in the trie below the base, it returns nil, and
  // io.EOF.  Returns nil and an error in case of errors.