Skip to content

Commit

Permalink
add godocs
Browse files Browse the repository at this point in the history
  • Loading branch information
likhita-809 committed Jul 8, 2021
1 parent c2b7589 commit 8b6e32e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions types/kv/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package kv

import "fmt"

// AssertKeyAtLeastLength panics when store key length is less than the given length.
func AssertKeyAtLeastLength(bz []byte, length int) {
if len(bz) < length {
panic(fmt.Sprintf("expected key of length at least %d, got %d", length, len(bz)))
}
}

// AssertKeyLength panics when store key length is not equal to the given length.
func AssertKeyLength(bz []byte, length int) {
if len(bz) != length {
panic(fmt.Sprintf("unexpected key length; got: %d, expected: %d", len(bz), length))
Expand Down

0 comments on commit 8b6e32e

Please sign in to comment.