Skip to content

Commit

Permalink
Resolve #4: Support keys with null bytes; Refactor internals, more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
plar committed Apr 24, 2019
1 parent dd19acb commit db5f983
Show file tree
Hide file tree
Showing 16 changed files with 6,053 additions and 496 deletions.
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ language: go
sudo: false

go:
- 1.5
- 1.6
- 1.7
- 1.8
- 1.10
- 1.11
- tip

# matrix:
# allow_failures:
# - go: 1.1.2

install:
- make bootstrap

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ It presents the following:
* Minimum / Maximum value lookups
* Ordered iteration
* Prefix based iteration
* Support keys with null bytes, any byte array could be a key

# Usage

Expand Down
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var (
type Kind int

// Key Type.
// Key can be a set of any characters include unicode chars and zero bytes.
// Key can be a set of any characters include unicode chars with null bytes.
type Key []byte

// Value type.
Expand Down
2 changes: 1 addition & 1 deletion consts.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package art

// node constraits
// node constraints
const (
node4Min = 2
node4Max = 4
Expand Down
1 change: 1 addition & 0 deletions factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type nodeFactory interface {
newLeaf(key Key, value interface{}) *artNode
}

// make sure that objFactory implements all methods of nodeFactory interface
var _ nodeFactory = &objFactory{}

var factory = newObjFactory()
Expand Down
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/plar/go-adaptive-radix-tree

go 1.12

require github.com/stretchr/testify v1.3.0
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
5 changes: 4 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ get:

all-tests:
@echo "*** Run tests..."
@go test -v .
@go test .

benchmark:
@echo "*** Run benchmarks..."
Expand All @@ -39,6 +39,9 @@ build:
@echo "*** Build project..."
@go build -v .

build-asm:
@go build -a -work -v -gcflags="-S -B -C" .

build-race:
@echo "*** Build project with race condition..."
@go build --race -v .
Expand Down
Loading

0 comments on commit db5f983

Please sign in to comment.