Skip to content

Commit

Permalink
Modified historycleanup file as per the Go Lintr suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rishi-salunkhe-mettle committed Jul 30, 2024
1 parent 7adb8a2 commit 330baa9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions endpointmanager/pkg/historycleanup/historycleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,21 @@ func GetInfoHistoryDuplicateData(ctx context.Context, store *postgresql.Store, q
}
}

duplicateInfoHistoryDataWriter.WriteAll(pruningData)
err = duplicateInfoHistoryDataWriter.WriteAll(pruningData)
if err != nil {
log.Fatal("Error writing to duplicateInfoHistoryDataWriter:", err)
}

duplicateInfoHistoryDataWriter.Flush()
if err := duplicateInfoHistoryDataWriter.Error(); err != nil {
log.Fatal("Error flushing duplicateInfoHistoryDataWriter:", err)
}

distinctURLWriter.Write([]string{url})
err = distinctURLWriter.Write([]string{url})
if err != nil {
log.Fatal("Error writing to distinctURLWriter:", err)
}

distinctURLWriter.Flush()
if err := distinctURLWriter.Error(); err != nil {
log.Fatal("Error flushing distinctURLWriter:", err)
Expand All @@ -171,9 +179,7 @@ func GetInfoHistoryDuplicateData(ctx context.Context, store *postgresql.Store, q
func flatten2D(data2D [][]string) []string {
var data1D []string
for _, row := range data2D {
for _, element := range row {
data1D = append(data1D, element)
}
data1D = append(data1D, row...)
}
return data1D
}
Expand Down

0 comments on commit 330baa9

Please sign in to comment.