code: func (trie *Trie) VisitPrefixes(key Prefix, visitor VisitorFunc) error {
  	// Nil key not allowed.
  	if key == nil {
  		panic(ErrNilPrefix)
  	}
  
  	// Empty trie must be handled explicitly.
  	if trie.prefix == nil {
  		return nil
  	}
  
  	// Walk the path matching key prefixes.
  	node := trie
  	prefix := key
  	offset := 0
  	for {
  		// Compute what part of prefix matches.
  		common := node.longestCommonPrefixLength(key)
  		key = key[common:]
  		offset += common
  
  		// Partial match means that there is no subtree matching prefix.
  		if common < len(node.prefix) {
  			return nil
  		}
  
  		// Call the visitor.
  		if item := node.item; item != nil {
  			if err := visitor(prefix[:offset], item); err != nil {
  				return err
  			}
  		}
  
  		if len(key) == 0 {
  			// This node represents key, we are finished.
  			return nil
  		}
  
  		// There is some key suffix left, move to the children.
  		child := node.children.next(key[0])
  		if child == nil {
  			// There is nowhere to continue, return.
  			return nil
  		}
  
  		node = child
  	}
  }
docs: // VisitPrefixes visits only nodes that represent prefixes of key.
  // To say the obvious, returning SkipSubtree from visitor makes no sense here.