Skip to content

Commit

Permalink
refactor: Remove forcing 64 bits uint
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <bob@vibioh.fr>
  • Loading branch information
ViBiOh committed Aug 19, 2024
1 parent 809f288 commit d0913d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/breaksync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (s *Synchronization) AddSources(sources ...SyncSource) *Synchronization {
return s
}

func (s *Synchronization) Run(business func(uint64, []any) error) (err error) {
func (s *Synchronization) Run(business func(uint, []any) error) (err error) {
if err = s.read(); err != nil {
return
}
Expand Down Expand Up @@ -98,8 +98,8 @@ func (s *Synchronization) computeRuptures() {
}
}

func (s *Synchronization) computeItems(items []any) uint64 {
var itemsFlags uint64
func (s *Synchronization) computeItems(items []any) uint {
var itemsFlags uint

for i, source := range s.sources {
if !source.IsSynchronized() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/breaksync/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func TestRun(t *testing.T) {
t.Parallel()

var result int
err := testCase.instance.Run(func(synchronization uint64, items []any) error {
err := testCase.instance.Run(func(synchronization uint, items []any) error {
if synchronization != 0 {
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (s Service) Get(ctx context.Context, scanner func(pgx.Row) error, query str
return scanner(s.QueryRow(ctx, query, args...))
}

func (s Service) Create(ctx context.Context, query string, args ...any) (id uint64, err error) {
func (s Service) Create(ctx context.Context, query string, args ...any) (id uint, err error) {
tx := readTx(ctx)
if tx == nil {
return 0, ErrNoTransaction
Expand All @@ -246,7 +246,7 @@ func (s Service) Create(ctx context.Context, query string, args ...any) (id uint
ctx, cancel := context.WithTimeout(ctx, SQLTimeout)
defer cancel()

var newID uint64
var newID uint

return newID, tx.QueryRow(ctx, query, args...).Scan(&newID)
}
Expand Down

0 comments on commit d0913d3

Please sign in to comment.