trie: new package (#3729)

This implements a simple trie tree for minio server/tools.
This package borrows idea from
https://godoc.org/golang.org/x/text/internal/triegen.
This commit is contained in:
Bala FA
2017-02-11 01:21:41 +05:30
committed by Harshavardhana
parent a799351926
commit 8912b6bf3b
4 changed files with 55 additions and 46 deletions

View File

@@ -94,7 +94,7 @@ func findClosestCommands(command string) []string {
sort.Strings(closestCommands)
// Suggest other close commands - allow missed, wrongly added and
// even transposed characters
for _, value := range commandsTree.walk(commandsTree.root) {
for _, value := range commandsTree.Walk(commandsTree.Root()) {
if sort.SearchStrings(closestCommands, value.(string)) < len(closestCommands) {
continue
}