Skip to content

Commit 63c2eff

Browse files
authored
docs: add migration section (#48)
Signed-off-by: Pavel Larkin <[email protected]>
1 parent 51b2cc7 commit 63c2eff

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,28 @@ func main() {
9393

9494
Check out the documentation on [pkg.go.dev/github.com/plar/go-adaptive-radix-tree/v2](https://pkg.go.dev/github.com/plar/go-adaptive-radix-tree/v2).
9595

96+
# Migration from v1 to v2
97+
98+
- update `import` statement
99+
100+
```
101+
from `art "github.com/plar/go-adaptive-radix-tree"`
102+
to `art "github.com/plar/go-adaptive-radix-tree/v2"`
103+
```
104+
105+
- update go module dependency
106+
107+
```
108+
$ go get github.com/plar/go-adaptive-radix-tree/v2
109+
$ go mod tidy
110+
```
111+
112+
If you had implemented your own version of the `Tree` interface, then you need to update the following method to support `options`. These are the only changes in the interface.
113+
114+
```
115+
ForEachPrefix(keyPrefix Key, callback Callback, options ...int)
116+
```
117+
96118
# Performance
97119

98120
[plar/go-adaptive-radix-tree](https://github.com/plar/go-adaptive-radix-tree) outperforms [kellydunn/go-art](https://github.com/kellydunn/go-art) by avoiding memory allocations during search operations.

0 commit comments

Comments
 (0)