Skip to content

Commit 7ce85dd

Browse files
committed
Update README
1 parent 640b08c commit 7ce85dd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ prefix. The implementation allows the user to associate data with each
1010
string, so it can act as a sort of flexible key-value store where
1111
searches succeed with the shortest unambiguous key prefix.
1212

13+
This is version 2 of the package, which you can retrieve using `go get`:
14+
15+
```sh
16+
go get github.com/beevik/prefixtree/v2
17+
```
18+
1319
### Example: Building a prefix tree
1420

1521
The following code adds strings and associated data (in this case an integer)
@@ -52,7 +58,7 @@ for _, prefix := range []string{
5258
"lemon meringue",
5359
"pear",
5460
} {
55-
value, err := tree.Find(prefix)
61+
value, err := tree.FindValue(prefix)
5662
fmt.Printf("%-18s %-8v %v\n", prefix, value, err)
5763
}
5864
```
@@ -68,7 +74,7 @@ apple p 30 <nil>
6874
apple pie 30 <nil>
6975
apple pies 0 prefixtree: prefix not found
7076
o 20 <nil>
71-
orang 20 <nil>
77+
oran 20 <nil>
7278
orange 20 <nil>
7379
oranges 0 prefixtree: prefix not found
7480
l 0 prefixtree: prefix ambiguous

0 commit comments

Comments
 (0)