Skip to content

Commit

Permalink
Merge branch 'generics'
Browse files Browse the repository at this point in the history
  • Loading branch information
superfell committed Apr 19, 2022
2 parents deb2297 + aa18c11 commit 9c9d3bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ Art is described in detail in the [ART paper](https://db.in.tum.de/~leis/papers/
## Usage

```go
a := new(art.Tree)
a := new(art.Tree[string])
k := []byte{1, 2, 4, 0, 1}
k2 := []byte{1, 2, 4, 0, 2}
a.Put(k, "bob")
v, exists := a.Get(k)
fmt.Printf("key %v exists %t with value %v\n", k, exists, v)
a.Put(k2, "eve")
a.Walk(func(k []byte, v interface{}) art.WalkState {
fmt.Printf("%v : %v\n", k, v)
return art.Continue
a.Walk(func(k []byte, v string) art.WalkState {
fmt.Printf("%v : %v\n", k, v)
return art.Continue
})
a.PrettyPrint(os.Stdout)
```
Expand Down

0 comments on commit 9c9d3bd

Please sign in to comment.