Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Address linter issues #20486

Merged
merged 4 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ require (
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cosmos/cosmos-db v1.0.2 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
github.com/cosmos/iavl v1.1.4 // indirect
github.com/cosmos/iavl v1.2.0 // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/dot v1.6.2 // indirect
Expand Down
1 change: 1 addition & 0 deletions runtime/v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8Jp
github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY=
github.com/cosmos/iavl v1.1.4 h1:Z0cVVjeQqOUp78/nWt/uhQy83vYluWlAMGQ4zbH9G34=
github.com/cosmos/iavl v1.1.4/go.mod h1:vCYmRQUJU1wwj0oRD3wMEtOM9sJNDP+GFMaXmIxZ/rU=
github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI=
github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=
github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
Expand Down
18 changes: 9 additions & 9 deletions types/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,11 @@ func (aa AccAddress) String() string {
func (aa AccAddress) Format(s fmt.State, verb rune) {
switch verb {
case 's':
s.Write([]byte(aa.String()))
_, _ = s.Write([]byte(aa.String()))
case 'p':
s.Write([]byte(fmt.Sprintf("%p", aa)))
_, _ = s.Write([]byte(fmt.Sprintf("%p", aa)))
default:
s.Write([]byte(fmt.Sprintf("%X", []byte(aa))))
_, _ = s.Write([]byte(fmt.Sprintf("%X", []byte(aa))))
}
}

Expand Down Expand Up @@ -456,11 +456,11 @@ func (va ValAddress) String() string {
func (va ValAddress) Format(s fmt.State, verb rune) {
switch verb {
case 's':
s.Write([]byte(va.String()))
_, _ = s.Write([]byte(va.String()))
case 'p':
s.Write([]byte(fmt.Sprintf("%p", va)))
_, _ = s.Write([]byte(fmt.Sprintf("%p", va)))
default:
s.Write([]byte(fmt.Sprintf("%X", []byte(va))))
_, _ = s.Write([]byte(fmt.Sprintf("%X", []byte(va))))
}
}

Expand Down Expand Up @@ -627,11 +627,11 @@ func MustBech32ifyAddressBytes(prefix string, bs []byte) string {
func (ca ConsAddress) Format(s fmt.State, verb rune) {
switch verb {
case 's':
s.Write([]byte(ca.String()))
_, _ = s.Write([]byte(ca.String()))
case 'p':
s.Write([]byte(fmt.Sprintf("%p", ca)))
_, _ = s.Write([]byte(fmt.Sprintf("%p", ca)))
default:
s.Write([]byte(fmt.Sprintf("%X", []byte(ca))))
_, _ = s.Write([]byte(fmt.Sprintf("%X", []byte(ca))))
}
}

Expand Down
4 changes: 2 additions & 2 deletions x/gov/types/v1/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ func ProposalStatusFromString(str string) (ProposalStatus, error) {
func (status ProposalStatus) Format(s fmt.State, verb rune) {
switch verb {
case 's':
s.Write([]byte(status.String()))
_, _ = s.Write([]byte(status.String()))
default:
// TODO: Do this conversion more directly
s.Write([]byte(fmt.Sprintf("%v", byte(status))))
_, _ = s.Write([]byte(fmt.Sprintf("%v", byte(status))))
}
}

Expand Down
4 changes: 2 additions & 2 deletions x/gov/types/v1/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ func ValidVoteOption(option VoteOption) bool {
func (vo VoteOption) Format(s fmt.State, verb rune) {
switch verb {
case 's':
s.Write([]byte(vo.String()))
_, _ = s.Write([]byte(vo.String()))
default:
s.Write([]byte(fmt.Sprintf("%v", byte(vo))))
_, _ = s.Write([]byte(fmt.Sprintf("%v", byte(vo))))
}
}
4 changes: 2 additions & 2 deletions x/gov/types/v1beta1/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ func ProposalStatusFromString(str string) (ProposalStatus, error) {
func (status ProposalStatus) Format(s fmt.State, verb rune) {
switch verb {
case 's':
s.Write([]byte(status.String()))
_, _ = s.Write([]byte(status.String()))
default:
// TODO: Do this conversion more directly
s.Write([]byte(fmt.Sprintf("%v", byte(status))))
_, _ = s.Write([]byte(fmt.Sprintf("%v", byte(status))))
}
}

Expand Down
4 changes: 2 additions & 2 deletions x/gov/types/v1beta1/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ func ValidVoteOption(option VoteOption) bool {
func (vo VoteOption) Format(s fmt.State, verb rune) {
switch verb {
case 's':
s.Write([]byte(vo.String()))
_, _ = s.Write([]byte(vo.String()))
default:
s.Write([]byte(fmt.Sprintf("%v", byte(vo))))
_, _ = s.Write([]byte(fmt.Sprintf("%v", byte(vo))))
}
}
3 changes: 0 additions & 3 deletions x/group/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ func (k Keeper) abortProposals(ctx context.Context, groupPolicyAddr sdk.AccAddre
return err
}

//nolint:gosec // "implicit memory aliasing in the for loop (because of the pointer on &proposalInfo)"
tac0turtle marked this conversation as resolved.
Show resolved Hide resolved
for _, proposalInfo := range proposals {
// Mark all proposals still in the voting phase as aborted.
if proposalInfo.Status == group.PROPOSAL_STATUS_SUBMITTED {
Expand Down Expand Up @@ -337,7 +336,6 @@ func (k Keeper) pruneVotes(ctx context.Context, proposalID uint64) error {
return err
}

//nolint:gosec // "implicit memory aliasing in the for loop (because of the pointer on &v)"
for _, v := range votes {
err = k.voteTable.Delete(k.KVStoreService.OpenKVStore(ctx), &v)
if err != nil {
Expand Down Expand Up @@ -410,7 +408,6 @@ func (k Keeper) TallyProposalsAtVPEnd(ctx context.Context) error {
if err != nil {
return nil
}
//nolint:gosec // "implicit memory aliasing in the for loop (because of the pointers in the loop)"
for _, proposal := range proposals {
policyInfo, err := k.getGroupPolicyInfo(ctx, proposal.GroupPolicyAddress)
if err != nil {
Expand Down
Loading