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 6a49102
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion services/horizon/internal/db2/history/key_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,17 @@ 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)

var offset int64
offset, err = strconv.ParseInt(pair.Value, 10, 64)
if err != nil {
return nil, fmt.Errorf("invalid offset: %s", pair.Value)
}
Expand Down

0 comments on commit 6a49102

Please sign in to comment.