Skip to content

Commit

Permalink
fix govet
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirms committed Jul 26, 2024
1 parent 57ed334 commit c1fdd25
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions services/horizon/internal/db2/history/key_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,20 @@ func (q *Q) getLookupTableReapOffsets(ctx context.Context) (map[string]int64, er
"key": keys,
})
err := q.Select(ctx, &pairs, query)
if err != nil {
return nil, err
}
for _, pair := range pairs {
table := strings.TrimSuffix(pair.Key, lookupTableReapOffsetSuffix)
if _, ok := historyLookupTables[table]; !ok {
return nil, fmt.Errorf("invalid key: %s", pair.Key)
}
offset, err := strconv.ParseInt(pair.Value, 10, 64)
if err != nil {

if offset, err := strconv.ParseInt(pair.Value, 10, 64); err != nil {

Check failure on line 237 in services/horizon/internal/db2/history/key_value.go

View workflow job for this annotation

GitHub Actions / check (ubuntu-22.04, 1.22.1)

declaration of "err" shadows declaration at line 227
return nil, fmt.Errorf("invalid offset: %s", pair.Value)
} else {
offsets[table] = offset
}
offsets[table] = offset
}
return offsets, err
}
Expand Down

0 comments on commit c1fdd25

Please sign in to comment.