Skip to content

Commit

Permalink
support row prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
disksing committed Mar 2, 2020
1 parent ff49e70 commit 41b3d40
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ func main() {
}

if *indexID == 0 {
key = append(key, []byte("_r")...)
rowValueInt, err := strconv.ParseInt(*rowValue, 10, 64)
if err != nil {
fmt.Printf("invalid row value: %s\n", *rowValue)
os.Exit(1)
if *rowValue != "" {
key = append(key, []byte("_r")...)
rowValueInt, err := strconv.ParseInt(*rowValue, 10, 64)
if err != nil {
fmt.Printf("invalid row value: %s\n", *rowValue)
os.Exit(1)
}
key = codec.EncodeInt(key, rowValueInt)
}
key = codec.EncodeInt(key, rowValueInt)
} else {
key = append(key, []byte("_i")...)
key = codec.EncodeInt(key, *indexID)
Expand Down

0 comments on commit 41b3d40

Please sign in to comment.