chore(all): replace all fmt.Errorf without paramters with errors.New (#21590)
This commit is contained in:
parent
644b263c71
commit
92f20f9794
@ -1,6 +1,7 @@
|
||||
package postgres
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@ -18,7 +19,7 @@ func (tm *objectIndexer) bindKeyParams(key interface{}) ([]interface{}, []string
|
||||
} else {
|
||||
key, ok := key.([]interface{})
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("expected key to be a slice")
|
||||
return nil, nil, errors.New("expected key to be a slice")
|
||||
}
|
||||
|
||||
return tm.bindParams(tm.typ.KeyFields, key)
|
||||
@ -55,7 +56,7 @@ func (tm *objectIndexer) bindValueParams(value interface{}) (params []interface{
|
||||
} else {
|
||||
values, ok := value.([]interface{})
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("expected values to be a slice")
|
||||
return nil, nil, errors.New("expected values to be a slice")
|
||||
}
|
||||
|
||||
return tm.bindParams(tm.typ.ValueFields, values)
|
||||
|
||||
@ -33,7 +33,7 @@ func rpcClient(cmd *cobra.Command) (rpc.CometRPC, error) {
|
||||
return nil, err
|
||||
}
|
||||
if rpcURI == "" {
|
||||
return nil, fmt.Errorf("rpc URI is empty")
|
||||
return nil, errors.New("rpc URI is empty")
|
||||
}
|
||||
|
||||
return rpchttp.New(rpcURI)
|
||||
|
||||
@ -2,7 +2,7 @@ package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"errors"
|
||||
|
||||
"cosmossdk.io/x/bank/v2/types"
|
||||
)
|
||||
@ -21,7 +21,7 @@ func NewQuerier(k *Keeper) types.QueryServer {
|
||||
// Params implements types.QueryServer.
|
||||
func (q querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
||||
if req == nil {
|
||||
return nil, fmt.Errorf("empty request")
|
||||
return nil, errors.New("empty request")
|
||||
}
|
||||
|
||||
params, err := q.params.Get(ctx)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user