From 6df785b9b34d29c79276b72e365b643bc0cd7c86 Mon Sep 17 00:00:00 2001 From: "Andrew Jackson (Ajax)" Date: Wed, 29 Nov 2023 10:17:52 -0600 Subject: [PATCH] fix: lint --- cmd/lotus-provider/migrate.go | 4 +++- provider/lpwinning/winning_task.go | 4 +--- storage/sealer/mock/mock.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/lotus-provider/migrate.go b/cmd/lotus-provider/migrate.go index 0e2227ee2..e0a005104 100644 --- a/cmd/lotus-provider/migrate.go +++ b/cmd/lotus-provider/migrate.go @@ -134,7 +134,9 @@ func fromMiner(cctx *cli.Context) (err error) { if err != nil { return xerrors.Errorf("opening miner metadata datastore: %w", err) } - defer mmeta.Close() + defer func() { + _ = mmeta.Close() + }() maddrBytes, err := mmeta.Get(ctx, datastore.NewKey("miner-address")) if err != nil { diff --git a/provider/lpwinning/winning_task.go b/provider/lpwinning/winning_task.go index a3159c768..f02ffa1ae 100644 --- a/provider/lpwinning/winning_task.go +++ b/provider/lpwinning/winning_task.go @@ -486,9 +486,7 @@ func (mb MiningBase) baseTime() time.Time { } func (mb MiningBase) afterPropDelay() time.Time { - base := mb.baseTime() - base.Add(randTimeOffset(time.Second)) - return base + return mb.baseTime().Add(randTimeOffset(time.Second)) } func (t *WinPostTask) mineBasic(ctx context.Context) { diff --git a/storage/sealer/mock/mock.go b/storage/sealer/mock/mock.go index cb498492f..a96e998e9 100644 --- a/storage/sealer/mock/mock.go +++ b/storage/sealer/mock/mock.go @@ -478,7 +478,7 @@ func (mgr *SectorMgr) StageFakeData(mid abi.ActorID, spt abi.RegisteredSealProof } buf := make([]byte, usize) - _, _ = rand.Read(buf) // nolint:gosec + _, _ = rand.Read(buf) // nolint:gosec lint:ignore SA1019 we need predictable "randomness" here id := storiface.SectorRef{ ID: abi.SectorID{