Skip to content

Commit 2dcd17a

Browse files
committed
Remove deprecated APIs that should have been removed in 1.0.0
1 parent 1fb9fd5 commit 2dcd17a

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func ExampleTree_usage() {
4646
"lemon meringue",
4747
"lemon meringues",
4848
} {
49-
value, err := tree.Find(s)
49+
value, err := tree.FindValue(s)
5050
fmt.Printf("%-18s %-8v %v\n", s, value, err)
5151
}
5252

prefixtree.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,6 @@ func (t *Tree) isTerminal() bool {
5757
return t.key != ""
5858
}
5959

60-
// Find searches the prefix tree for all key strings prefixed by the
61-
// provided prefix and returns them.
62-
//
63-
// Deprecated: Use FindValue instead.
64-
func (t *Tree) Find(prefix string) (value any, err error) {
65-
return t.FindValue(prefix)
66-
}
67-
68-
// FindAll searches the prefix tree for all key strings prefixed by the
69-
// provided prefix. All associated values are returned.
70-
//
71-
// Deprecated: Use FindValues instead.
72-
func (t *Tree) FindAll(prefix string) (values []any) {
73-
return t.FindValues(prefix)
74-
}
75-
7660
// FindKey searches the prefix tree for a key string that uniquely matches the
7761
// prefix. If found, the full matching key is returned. If not found,
7862
// ErrPrefixNotFound is returned. If the prefix matches more than one key in

prefixtree_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func test(t *testing.T, entries []entry, cases []testcase) *Tree {
3434

3535
fail := false
3636
for _, c := range cases {
37-
value, err := tree.Find(c.key)
37+
value, err := tree.FindValue(c.key)
3838
if c.err != nil {
3939
if err != c.err {
4040
fail = true
@@ -352,7 +352,7 @@ func TestDictionary(t *testing.T) {
352352
"diametrically",
353353
}
354354
for i, key := range keys {
355-
_, err := tree.Find(key)
355+
_, err := tree.FindValue(key)
356356
if err != nil {
357357
t.Errorf("Case %d: Find(\"%s\") encountered error: %v\n", i, key, err)
358358
}
@@ -366,7 +366,7 @@ func TestDictionary(t *testing.T) {
366366
"dea",
367367
}
368368
for i, key := range keys {
369-
_, err := tree.Find(key)
369+
_, err := tree.FindValue(key)
370370
if err != ErrPrefixAmbiguous {
371371
t.Errorf("Case %d: Find(\"%s\") should have been ambiguous\n", i, key)
372372
}
@@ -410,7 +410,7 @@ func BenchmarkDictionary(b *testing.B) {
410410
"ruddy",
411411
}
412412
for _, key := range keys {
413-
_, err := tree.Find(key)
413+
_, err := tree.FindValue(key)
414414
if err != nil {
415415
b.Errorf("Find(\"%s\") encountered error: %v\n", key, err)
416416
}

0 commit comments

Comments
 (0)