// FindMatchingPrefix finds all the matching prefixes against to the input `key`.
// The keys returned are the prefixes of the input `key`.
FindMatchingPrefix finds all the matching prefixes against to the input `key`.
The keys returned are the prefixes of the input `key`.
// FindMatchingPrefix finds all the matching prefixes against to the input ` key ` . // The keys returned are the prefixes of the input ` key ` .
func (t *Trie) FindMatchingPrefix(key string) ([]string, bool) {
	t.mu.RLock()
	defer t.mu.RUnlock()
	nodes, ok := t.findPrefixMatchNodes(key)
	if ok {
		keys := make([]string, 0, len(nodes))
		for _, n := range nodes {
			keys = append(keys, n.path)
		}
		return keys, true
	}
	return nil, false
}
func ( t * Trie ) FindMatchingPrefix ( key string ) ( [ ] string , bool ) { t . mu . RLock ( ) defer t . mu . RUnlock ( ) nodes , ok := t . findPrefixMatchNodes ( key ) if ok { keys := make ( [ ] string , 0 , len ( nodes ) ) for _ , n := range nodes { keys = append ( keys , n . path ) } return keys , true } return nil , false }
FindMatchingPrefix finds all the matching prefixes against to the input `key`.
FindMatchingPrefix finds all the matching prefixes against to the input ` key ` .