chore(all): replace all fmt.Errorf without paramters with errors.New (#21068)
This commit is contained in:
@@ -3,7 +3,6 @@ package query
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"cosmossdk.io/collections"
|
||||
collcodec "cosmossdk.io/collections/codec"
|
||||
@@ -87,7 +86,7 @@ func CollectionFilteredPaginate[K, V any, C Collection[K, V], T any](
|
||||
reverse := pageReq.Reverse
|
||||
|
||||
if offset > 0 && key != nil {
|
||||
return nil, nil, fmt.Errorf("invalid request, either offset or key is expected, got both")
|
||||
return nil, nil, errors.New("invalid request, either offset or key is expected, got both")
|
||||
}
|
||||
|
||||
opt := new(CollectionsPaginateOptions[K])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"errors"
|
||||
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
|
||||
@@ -26,7 +26,7 @@ func FilteredPaginate(
|
||||
pageRequest = initPageRequestDefaults(pageRequest)
|
||||
|
||||
if pageRequest.Offset > 0 && pageRequest.Key != nil {
|
||||
return nil, fmt.Errorf("invalid request, either offset or key is expected, got both")
|
||||
return nil, errors.New("invalid request, either offset or key is expected, got both")
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -151,7 +151,7 @@ func GenericFilteredPaginate[T, F proto.Message](
|
||||
results := []F{}
|
||||
|
||||
if pageRequest.Offset > 0 && pageRequest.Key != nil {
|
||||
return results, nil, fmt.Errorf("invalid request, either offset or key is expected, got both")
|
||||
return results, nil, errors.New("invalid request, either offset or key is expected, got both")
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"errors"
|
||||
"math"
|
||||
|
||||
db "github.com/cosmos/cosmos-db"
|
||||
@@ -62,7 +62,7 @@ func Paginate(
|
||||
pageRequest = initPageRequestDefaults(pageRequest)
|
||||
|
||||
if pageRequest.Offset > 0 && pageRequest.Key != nil {
|
||||
return nil, fmt.Errorf("invalid request, either offset or key is expected, got both")
|
||||
return nil, errors.New("invalid request, either offset or key is expected, got both")
|
||||
}
|
||||
|
||||
iterator := getIterator(prefixStore, pageRequest.Key, pageRequest.Reverse)
|
||||
|
||||
Reference in New Issue
Block a user