Skip to content

Commit

Permalink
more lints
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Jan 31, 2024
1 parent ffac0a2 commit 587253c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion snapshots/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (s *Store) Save(
snapshotHasher := sha256.New()
chunkHasher := sha256.New()
for chunkBody := range chunks {
defer chunkBody.Close()
defer chunkBody.Close()

Check failure on line 263 in snapshots/store.go

View workflow job for this annotation

GitHub Actions / Analyze

SA9001: defers in this range loop won't run unless the channel gets closed (staticcheck)

Check failure on line 263 in snapshots/store.go

View workflow job for this annotation

GitHub Actions / golangci-lint

SA9001: defers in this range loop won't run unless the channel gets closed (staticcheck)
dir := s.pathSnapshot(height, format)
err = os.MkdirAll(dir, 0o755)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions types/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 8 additions & 6 deletions x/auth/vesting/types/period.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 587253c

Please sign in to comment.