bdjuno icon indicating copy to clipboard operation
bdjuno copied to clipboard

Go lint issues

Open haryunio opened this issue 6 months ago • 0 comments

Bug description

modules/actions/types/worker.go:98:9: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
	err := http.ListenAndServe(fmt.Sprintf(":%d", port), w.mux)
	       ^
modules/auth/handle_msg.go:57:32: G115: integer overflow conversion uint64 -> int64 (gosec)
	return m.RefreshAccounts(int64(tx.Height), moduleutils.FilterNonAccountAddresses(addresses))
	                              ^
modules/distribution/handle_msg.go:28:37: G115: integer overflow conversion uint64 -> int64 (gosec)
		return m.updateCommunityPool(int64(tx.Height))
		                                  ^
modules/feegrant/handle_msg.go:63:69: G115: integer overflow conversion uint64 -> int64 (gosec)
	return m.db.SaveFeeGrantAllowance(types.NewFeeGrant(feeGrant, int64(tx.Height)))
	                                                                   ^
modules/feegrant/handle_msg.go:68:91: G115: integer overflow conversion uint64 -> int64 (gosec)
	return m.db.DeleteFeeGrantAllowance(types.NewGrantRemoval(msg.Grantee, msg.Granter, int64(tx.Height)))
	                                                                                         ^
modules/gov/handle_msg.go:104:42: G115: integer overflow conversion uint64 -> int64 (gosec)
	proposal, err := m.source.Proposal(int64(tx.Height), proposalID)
	                                        ^
modules/gov/handle_msg.go:173:55: G115: integer overflow conversion uint64 -> int64 (gosec)
	err = m.UpdateSingleProposalStakingPoolSnapshot(int64(tx.Height), proposal.Id)
	                                                     ^
modules/gov/handle_msg.go:193:48: G115: integer overflow conversion uint64 -> int64 (gosec)
	deposit, err := m.source.ProposalDeposit(int64(tx.Height), proposalID, depositor)
	                                              ^
modules/gov/handle_msg.go:203:88: G115: integer overflow conversion uint64 -> int64 (gosec)
		types.NewDeposit(proposalID, depositor, deposit.Amount, txTimestamp, tx.TxHash, int64(tx.Height)),
		                                                                                     ^
modules/gov/handle_msg.go:226:111: G115: integer overflow conversion uint64 -> int64 (gosec)
	vote := types.NewVote(proposalID, voter, weightVoteOption.Option, weightVoteOption.Weight, txTimestamp, int64(tx.Height))
	                                                                                                             ^
modules/gov/handle_msg.go:234:54: G115: integer overflow conversion uint64 -> int64 (gosec)
	return m.UpdateProposalTallyResult(proposalID, int64(tx.Height))
	                                                    ^
modules/message_type/handle_msg.go:17:8: G115: integer overflow conversion uint64 -> int64 (gosec)
		int64(tx.Height)))
		     ^
modules/staking/handle_msg.go:38:42: G115: integer overflow conversion uint64 -> int64 (gosec)
		return m.handleMsgCreateValidator(int64(tx.Height), cosmosMsg)
		                                       ^
modules/staking/handle_msg.go:42:37: G115: integer overflow conversion uint64 -> int64 (gosec)
		return m.handleEditValidator(int64(tx.Height), cosmosMsg)
		                                  ^
cmd/parse/staking/staking.go:17:6: func poolCmd is unused (unused)
func poolCmd(parseConfig *parsecmdtypes.Config) *cobra.Command {
     ^
15 issues:
* gosec: 14
* unused: 1

Steps to reproduce

golangci-lint run

Details

we need to fix these gosec lint issues in the next version

haryunio avatar Jul 28 '25 08:07 haryunio