package bastion_init import ( "fmt" "testing" ) func TestNewTrie(t *testing.T) { words := []string{"apple", "apricot", "apprentice", "application"} tcc := NewTrie() tcc.InsertAll(words) prefix := "ap" closest, err := FindClosestWord(tcc, prefix) if err != nil { fmt.Println(err) } else { fmt.Printf("The closest word to '%s' is '%s'\n", prefix, closest) } }