Skip to content

Commit 1f2875d

Browse files
authored
style: gofumpt linting (#15605)
1 parent 24344fb commit 1f2875d

56 files changed

Lines changed: 97 additions & 97 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/v2/autocli/common_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ func testExecCommon(t *testing.T, buildModuleCommand func(string, *Builder) (*co
4949
Builder: flag.Builder{
5050
GetClientConn: func() (grpc.ClientConnInterface, error) {
5151
return conn, nil
52-
}},
52+
},
53+
},
5354
GetClientConn: func(*cobra.Command) (grpc.ClientConnInterface, error) {
5455
return conn, nil
5556
},

client/v2/autocli/query_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ func TestJSONParsing(t *testing.T) {
159159
"-u", "27", // shorthand
160160
)
161161
assert.DeepEqual(t, conn.lastRequest, conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform())
162-
163162
}
164163

165164
func TestOptions(t *testing.T) {
@@ -319,7 +318,7 @@ type testClientConn struct {
319318
errorOut *bytes.Buffer
320319
}
321320

322-
func (t *testClientConn) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error {
321+
func (t *testClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...grpc.CallOption) error {
323322
err := t.ClientConn.Invoke(ctx, method, args, reply, opts...)
324323
t.lastRequest = args
325324
t.lastResponse = reply

collections/indexes/multi_pair.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type pairKeyCodec[K1, K2 any] interface {
2424
// NewMultiPair instantiates a new MultiPair index.
2525
// NOTE: when using this function you will need to type hint: doing NewMultiPair[Value]()
2626
// Example: if the value of the indexed map is string, you need to do NewMultiPair[string](...)
27-
func NewMultiPair[Value any, K1, K2 any](
27+
func NewMultiPair[Value, K1, K2 any](
2828
sb *collections.SchemaBuilder,
2929
prefix collections.Prefix,
3030
name string,

collections/iter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type Ranger[K any] interface {
7575
// iteration will yield keys from the smallest to the biggest, if order
7676
// is OrderDescending then the iteration will yield keys from the biggest to the smallest.
7777
// Ordering is defined by the keys bytes representation, which is dependent on the KeyCodec used.
78-
RangeValues() (start *RangeKey[K], end *RangeKey[K], order Order, err error)
78+
RangeValues() (start, end *RangeKey[K], order Order, err error)
7979
}
8080

8181
// Range is a Ranger implementer.
@@ -126,7 +126,7 @@ var (
126126
errOrder = errors.New("collections: invalid order")
127127
)
128128

129-
func (r *Range[K]) RangeValues() (start *RangeKey[K], end *RangeKey[K], order Order, err error) {
129+
func (r *Range[K]) RangeValues() (start, end *RangeKey[K], order Order, err error) {
130130
return r.start, r.end, r.order, nil
131131
}
132132

collections/iter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func TestWalk(t *testing.T) {
175175
}
176176

177177
u := uint64(0)
178-
err = m.Walk(ctx, nil, func(key uint64, value uint64) bool {
178+
err = m.Walk(ctx, nil, func(key, value uint64) bool {
179179
if key == 5 {
180180
return true
181181
}

collections/pair.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func (p *PairRange[K1, K2]) Descending() *PairRange[K1, K2] {
261261
return p
262262
}
263263

264-
func (p *PairRange[K1, K2]) RangeValues() (start *RangeKey[Pair[K1, K2]], end *RangeKey[Pair[K1, K2]], order Order, err error) {
264+
func (p *PairRange[K1, K2]) RangeValues() (start, end *RangeKey[Pair[K1, K2]], order Order, err error) {
265265
if p.err != nil {
266266
return nil, nil, 0, err
267267
}

crypto/keys/secp256k1/secp256k1_cgo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ func (privKey *PrivKey) Sign(msg []byte) ([]byte, error) {
2222

2323
// VerifySignature validates the signature.
2424
// The msg will be hashed prior to signature verification.
25-
func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool {
25+
func (pubKey *PubKey) VerifySignature(msg, sigStr []byte) bool {
2626
return secp256k1.VerifySignature(pubKey.Bytes(), crypto.Sha256(msg), sigStr)
2727
}

depinject/binding_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ func fullTypeName(typeName string) string {
131131
return fmt.Sprintf("cosmossdk.io/depinject_test/depinject_test.%s", typeName)
132132
}
133133

134-
func (s *bindingSuite) ThereIsAGlobalBindingForA(preferredType string, interfaceType string) {
134+
func (s *bindingSuite) ThereIsAGlobalBindingForA(preferredType, interfaceType string) {
135135
s.addConfig(depinject.BindInterface(fullTypeName(interfaceType), fullTypeName(preferredType)))
136136
}
137137

138-
func (s *bindingSuite) ThereIsABindingForAInModule(preferredType string, interfaceType string, moduleName string) {
138+
func (s *bindingSuite) ThereIsABindingForAInModule(preferredType, interfaceType, moduleName string) {
139139
s.addConfig(depinject.BindInterfaceInModule(moduleName, fullTypeName(interfaceType), fullTypeName(preferredType)))
140140
}
141141

@@ -147,7 +147,7 @@ func (s *bindingSuite) ModuleWantsADuck(module string) {
147147
s.addConfig(depinject.ProvideInModule(module, ProvideModuleDuck))
148148
}
149149

150-
func (s *bindingSuite) ModuleResolvesA(module string, duckType string) {
150+
func (s *bindingSuite) ModuleResolvesA(module, duckType string) {
151151
pond := s.resolvePond()
152152
moduleFound := false
153153
for _, dw := range pond.Ducks {

depinject/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func invoke(ctr *container, key *moduleKey, invokers []interface{}) error {
109109
//
110110
// "cosmossdk.io/depinject_test/depinject_test.Duck",
111111
// "cosmossdk.io/depinject_test/depinject_test.Canvasback")
112-
func BindInterface(inTypeName string, outTypeName string) Config {
112+
func BindInterface(inTypeName, outTypeName string) Config {
113113
return containerConfig(func(ctr *container) error {
114114
return bindInterface(ctr, inTypeName, outTypeName, "")
115115
})
@@ -125,13 +125,13 @@ func BindInterface(inTypeName string, outTypeName string) Config {
125125
// "moduleFoo",
126126
// "cosmossdk.io/depinject_test/depinject_test.Duck",
127127
// "cosmossdk.io/depinject_test/depinject_test.Canvasback")
128-
func BindInterfaceInModule(moduleName string, inTypeName string, outTypeName string) Config {
128+
func BindInterfaceInModule(moduleName, inTypeName, outTypeName string) Config {
129129
return containerConfig(func(ctr *container) error {
130130
return bindInterface(ctr, inTypeName, outTypeName, moduleName)
131131
})
132132
}
133133

134-
func bindInterface(ctr *container, inTypeName string, outTypeName string, moduleName string) error {
134+
func bindInterface(ctr *container, inTypeName, outTypeName, moduleName string) error {
135135
var mk *moduleKey
136136
if moduleName != "" {
137137
mk = &moduleKey{name: moduleName}

depinject/internal/codegen/type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func (g *FileGen) TypeExpr(typ reflect.Type) (ast.Expr, error) {
119119

120120
var genericTypeNameRegex = regexp.MustCompile(`(\w+)\[(.*)]`)
121121

122-
func (g *FileGen) importGenericTypeParams(typeName string, pkgPath string) (newTypeName string) {
122+
func (g *FileGen) importGenericTypeParams(typeName, pkgPath string) (newTypeName string) {
123123
// a generic type parameter from the same package the generic type is defined won't have the
124124
// full package name so we need to compare it with the final package part (the default import prefix)
125125
// ex: for a/b.C in package a/b, we'll just see the type param b.C.

0 commit comments

Comments
 (0)