From 587253c4727bf2f72ed78ce43efdfe73d51caf6b Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Wed, 31 Jan 2024 12:50:31 -0700 Subject: [PATCH] more lints --- snapshots/store.go | 2 +- types/result.go | 2 -- x/auth/vesting/types/period.go | 14 ++++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/snapshots/store.go b/snapshots/store.go index 3ceafa2bbe03..bfcddc89b93a 100644 --- a/snapshots/store.go +++ b/snapshots/store.go @@ -260,7 +260,7 @@ func (s *Store) Save( snapshotHasher := sha256.New() chunkHasher := sha256.New() for chunkBody := range chunks { - defer chunkBody.Close() + defer chunkBody.Close() dir := s.pathSnapshot(height, format) err = os.MkdirAll(dir, 0o755) if err != nil { diff --git a/types/result.go b/types/result.go index 536a37828271..21daec7f1b47 100644 --- a/types/result.go +++ b/types/result.go @@ -14,8 +14,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" ) -var cdc = codec.NewLegacyAmino() - func (gi GasInfo) String() string { bz, _ := codec.MarshalYAML(codec.NewProtoCodec(nil), &gi) return string(bz) diff --git a/x/auth/vesting/types/period.go b/x/auth/vesting/types/period.go index c494ce53eba8..ca24bdb6b6e9 100644 --- a/x/auth/vesting/types/period.go +++ b/x/auth/vesting/types/period.go @@ -176,11 +176,12 @@ func DisjunctPeriods(startP, startQ int64, periodsP, periodsQ []Period) (int64, for iP < lenP && iQ < lenQ { nextP := timeP + periodsP[iP].Length // next p event in absolute time nextQ := timeQ + periodsQ[iQ].Length // next q event in absolute time - if nextP < nextQ { + switch { + case nextP < nextQ: consumeP(nextP) - } else if nextP > nextQ { + case nextP > nextQ: consumeQ(nextQ) - } else { + default: consumeBoth(nextP) } } @@ -275,11 +276,12 @@ func ConjunctPeriods(startP, startQ int64, periodsP, periodsQ []Period) (startTi for iP < lenP && iQ < lenQ { nextP := timeP + periodsP[iP].Length // next p event in absolute time nextQ := timeQ + periodsQ[iQ].Length // next q event in absolute time - if nextP < nextQ { + switch { + case nextP < nextQ: consumeP(nextP) - } else if nextP > nextQ { + case nextP > nextQ: consumeQ(nextQ) - } else { + default: consumeBoth(nextP) } }