diff --git a/internal/datastore/postgres/watch.go b/internal/datastore/postgres/watch.go index 2c7a2d3c97..a562c4adfe 100644 --- a/internal/datastore/postgres/watch.go +++ b/internal/datastore/postgres/watch.go @@ -402,15 +402,15 @@ func (pgd *pgDatastore) loadNamespaceChanges(ctx context.Context, xmin uint64, x return nil } -func (pgd *pgDatastore) loadCaveatChanges(ctx context.Context, min uint64, max uint64, txidToRevision map[uint64]postgresRevision, filter map[uint64]int, tracked *common.Changes[postgresRevision, uint64]) error { +func (pgd *pgDatastore) loadCaveatChanges(ctx context.Context, minimum uint64, maximum uint64, txidToRevision map[uint64]postgresRevision, filter map[uint64]int, tracked *common.Changes[postgresRevision, uint64]) error { sql, args, err := queryChangedCaveats.Where(sq.Or{ sq.And{ - sq.LtOrEq{colCreatedXid: max}, - sq.GtOrEq{colCreatedXid: min}, + sq.LtOrEq{colCreatedXid: maximum}, + sq.GtOrEq{colCreatedXid: minimum}, }, sq.And{ - sq.LtOrEq{colDeletedXid: max}, - sq.GtOrEq{colDeletedXid: min}, + sq.LtOrEq{colDeletedXid: maximum}, + sq.GtOrEq{colDeletedXid: minimum}, }, }).ToSql() if err != nil { diff --git a/internal/services/v1/experimental_test.go b/internal/services/v1/experimental_test.go index 1e692a6e52..fa0abc5f8a 100644 --- a/internal/services/v1/experimental_test.go +++ b/internal/services/v1/experimental_test.go @@ -117,12 +117,12 @@ func constBatch(size int) func() int { } } -func randomBatch(min int, max int) func() int { +func randomBatch(minimum, max int) func() int { return func() int { // nolint:gosec // G404 use of non cryptographically secure random number generator is not a security concern here, // as this is only used for generating fixtures in testing. - return rand.Intn(max-min) + min + return rand.Intn(max-minimum) + minimum } }