From c1fdd25068c5dd62bbda57bb634808462ce43802 Mon Sep 17 00:00:00 2001 From: tamirms Date: Fri, 26 Jul 2024 15:09:32 +0100 Subject: [PATCH] fix govet --- services/horizon/internal/db2/history/key_value.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/horizon/internal/db2/history/key_value.go b/services/horizon/internal/db2/history/key_value.go index f9c49b04a6..cd65de9c4a 100644 --- a/services/horizon/internal/db2/history/key_value.go +++ b/services/horizon/internal/db2/history/key_value.go @@ -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 { return nil, fmt.Errorf("invalid offset: %s", pair.Value) + } else { + offsets[table] = offset } - offsets[table] = offset } return offsets, err }