type Trie … // NewTrie creates a Trie and add all strings in the provided list to it. func NewTrie(list []string) Trie { … } // Add adds a word to this trie func (t *Trie) Add(v string) { … } // HasPrefix returns true of v has any of the prefixes stored in this trie. func (t *Trie) HasPrefix(v string) bool { … } // GetPrefix is like HasPrefix but return the prefix in case of match or empty string otherwise. func (t *Trie) GetPrefix(v string) (string, bool) { … }