Skip to content

Commit

Permalink
Merge pull request #336 from comdex-official/gosec-error
Browse files Browse the repository at this point in the history
resovle and ignore few lint errors
  • Loading branch information
dheerajkd30 authored Jul 11, 2022
2 parents e5fced7 + 3edb440 commit 7f6268d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion x/asset/client/cli/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func parseAssetMappingFlags(fs *pflag.FlagSet) (*createAddAssetMappingInputs, er
return nil, fmt.Errorf("must pass in add asset mapping json using the --%s flag", FlagAddAssetMappingFile)
}

contents, err := ioutil.ReadFile(addAssetMappingFile)
contents, err := ioutil.ReadFile(addAssetMappingFile) //nolint:gosec
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions x/lend/client/cli/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func parseAddNewLendPairsFlags(fs *pflag.FlagSet) (*addNewLendPairsInputs, error
return nil, fmt.Errorf("must pass in a add new lend pairs json using the --%s flag", FlagNewLendPairFile)
}

contents, err := ioutil.ReadFile(addLendPairsParamsFile)
contents, err := ioutil.ReadFile(addLendPairsParamsFile) //nolint:gosec
if err != nil {
return nil, err
}
Expand All @@ -97,7 +97,7 @@ func parseAddPoolFlags(fs *pflag.FlagSet) (*addLendPoolInputs, error) {
return nil, fmt.Errorf("must pass in a add new pool json using the --%s flag", FlagAddLendPoolFile)
}

contents, err := ioutil.ReadFile(addPoolParamsParamsFile)
contents, err := ioutil.ReadFile(addPoolParamsParamsFile) //nolint:gosec
if err != nil {
return nil, err
}
Expand All @@ -119,7 +119,7 @@ func parseAssetRateStatsFlags(fs *pflag.FlagSet) (*addAssetRatesStatsInputs, err
return nil, fmt.Errorf("must pass in a add asset rates stats json using the --%s flag", FlagAddAssetRatesStatsFile)
}

contents, err := ioutil.ReadFile(addAssetRatesStatsFile)
contents, err := ioutil.ReadFile(addAssetRatesStatsFile) //nolint:gosec
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion x/liquidity/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (
TypeMsgCancelOrder = "cancel_order"
TypeMsgCancelAllOrders = "cancel_all_orders"
TypeMsgTokensSoftLock = "tokens_soft_lock"
TypeMsgTokensSoftUnlock = "tokens_soft_unlock"
TypeMsgTokensSoftUnlock = "tokens_soft_unlock" //nolint:gosec
)

// NewMsgCreatePair returns a new MsgCreatePair.
Expand Down
11 changes: 7 additions & 4 deletions x/vault/client/testutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ func MsgCreate(
if err != nil {
return resp, err
}
var respJson map[string]interface{}
json.Unmarshal([]byte(resp.String()), &respJson)
if respJson["code"] != 0 {
errLog, _ := respJson["raw_log"].(string)
var respJSON map[string]interface{}
err = json.Unmarshal([]byte(resp.String()), &respJSON)
if err != nil {
return nil, err
}
if respJSON["code"] != 0 {
errLog, _ := respJSON["raw_log"].(string)
err = fmt.Errorf(errLog)
}
return resp, err
Expand Down

0 comments on commit 7f6268d

Please sign in to comment.