Skip to content

Commit e9eecb0

Browse files
committed
remove lo
1 parent 83ea752 commit e9eecb0

31 files changed

+9
-8693
lines changed

internal/verifier/check.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ func (verifier *Verifier) CheckDriver(ctx context.Context, filter map[string]any
232232
verifier.lastGeneration = true
233233
}
234234
verifier.generation++
235-
236235
verifier.phase = Recheck
237236
err = verifier.GenerateRecheckTasks(ctx)
238237
if err != nil {
@@ -362,11 +361,14 @@ func (verifier *Verifier) Work(ctx context.Context, workerNum int, wg *sync.Wait
362361
task, err := verifier.FindNextVerifyTaskAndUpdate()
363362
if errors.Is(err, mongo.ErrNoDocuments) {
364363
delay := verifier.workerSleepDelayMillis * time.Millisecond
364+
365365
verifier.logger.Debug().
366+
Int("workerNum", workerNum).
366367
Stringer("duration", delay).
367-
Msgf("[Worker %d] No tasks found, sleeping ...", workerNum)
368+
Msg("No tasks found. Worker sleeping ...")
368369

369370
time.Sleep(delay)
371+
370372
continue
371373
} else if err != nil {
372374
panic(err)

internal/verifier/summary.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/10gen/migration-verifier/internal/reportutils"
1616
"github.com/10gen/migration-verifier/internal/types"
1717
"github.com/olekukonko/tablewriter"
18-
"github.com/samber/lo"
1918
"golang.org/x/exp/maps"
2019
)
2120

@@ -381,11 +380,11 @@ func (verifier *Verifier) printChangeEventStatistics(builder *strings.Builder) {
381380
totalEvents += nsTotals[ns]
382381
}
383382

384-
eventsDescr := lo.Ternary(
385-
totalEvents == 0,
386-
"0",
387-
fmt.Sprintf("%d total, across %d namespace(s)", totalEvents, activeNamespacesCount),
388-
)
383+
eventsDescr := "none"
384+
if totalEvents > 0 {
385+
eventsDescr = fmt.Sprintf("%d total, across %d namespace(s)", totalEvents, activeNamespacesCount)
386+
}
387+
389388
builder.WriteString(fmt.Sprintf("\nChange events this generation: %s\n", eventsDescr))
390389

391390
if totalEvents == 0 {

vendor/github.com/samber/lo/.gitignore

Lines changed: 0 additions & 38 deletions
This file was deleted.

vendor/github.com/samber/lo/.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)