Skip to content

Commit

Permalink
fix BatchGet.From and FromRange with different table
Browse files Browse the repository at this point in the history
  • Loading branch information
guregu committed May 4, 2024
1 parent 67f288f commit 3ba3d5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions batchget.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ func (bg *BatchGet) add(table Table, hashKey string, rangeKey string, keys ...Ke
bg.setError(errors.New("dynamo: batch: the Keyed interface must not be nil"))
break
}
get := bg.batch.table.Get(bg.batch.hashKey, key.HashKey())
if rk := key.RangeKey(); bg.batch.rangeKey != "" && rk != nil {
get.Range(bg.batch.rangeKey, Equal, rk)
get := table.Get(hashKey, key.HashKey())
if rk := key.RangeKey(); rangeKey != "" && rk != nil {
get.Range(rangeKey, Equal, rk)
bg.setError(get.err)
}
bg.reqs = append(bg.reqs, get)
Expand Down

0 comments on commit 3ba3d5d

Please sign in to comment.