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(all): replace all fmt.Errorf without paramters with errors.New #21590

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 3 additions & 2 deletions indexer/postgres/params.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package postgres

import (
"errors"
"fmt"
"time"

Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion server/v2/cometbft/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions x/bank/v2/keeper/query_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package keeper

import (
"context"
"fmt"
"errors"

"cosmossdk.io/x/bank/v2/types"
)
Expand All @@ -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)
Expand Down
Loading