Skip to content

Commit b843748

Browse files
committed
accounts/abi: golangci-lint 1.61.0 (ethereum#30587)
1 parent 756752c commit b843748

File tree

7 files changed

+1
-9
lines changed

7 files changed

+1
-9
lines changed

accounts/abi/abi_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,6 @@ func TestUnpackRevert(t *testing.T) {
12001200
{"4e487b7100000000000000000000000000000000000000000000000000000000000000ff", "unknown panic code: 0xff", nil},
12011201
}
12021202
for index, c := range cases {
1203-
index, c := index, c
12041203
t.Run(fmt.Sprintf("case %d", index), func(t *testing.T) {
12051204
t.Parallel()
12061205
got, err := UnpackRevert(common.Hex2Bytes(c.input))

accounts/abi/bind/bind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
253253
}
254254
// Parse library references.
255255
for pattern, name := range libs {
256-
matched, err := regexp.Match("__\\$"+pattern+"\\$__", []byte(contracts[types[i]].InputBin))
256+
matched, err := regexp.MatchString("__\\$"+pattern+"\\$__", contracts[types[i]].InputBin)
257257
if err != nil {
258258
log.Error("Could not search for pattern", "pattern", pattern, "contract", contracts[types[i]], "err", err)
259259
}

accounts/abi/event_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ func TestEventTupleUnpack(t *testing.T) {
331331

332332
for _, tc := range testCases {
333333
assert := assert.New(t)
334-
tc := tc
335334
t.Run(tc.name, func(t *testing.T) {
336335
err := unpackTestEventData(tc.dest, tc.data, tc.jsonLog, assert)
337336
if tc.error == "" {

accounts/abi/pack_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
func TestPack(t *testing.T) {
3535
t.Parallel()
3636
for i, test := range packUnpackTests {
37-
i, test := i, test
3837
t.Run(strconv.Itoa(i), func(t *testing.T) {
3938
t.Parallel()
4039
encb, err := hex.DecodeString(test.packed)

accounts/abi/reflect_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ var reflectTests = []reflectTest{
172172
func TestReflectNameToStruct(t *testing.T) {
173173
t.Parallel()
174174
for _, test := range reflectTests {
175-
test := test
176175
t.Run(test.name, func(t *testing.T) {
177176
t.Parallel()
178177
m, err := mapArgNamesToStructFields(test.args, reflect.ValueOf(test.struc))

accounts/abi/topics_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ func TestMakeTopics(t *testing.T) {
137137
},
138138
}
139139
for _, tt := range tests {
140-
tt := tt
141140
t.Run(tt.name, func(t *testing.T) {
142141
t.Parallel()
143142
got, err := MakeTopics(tt.args.query...)
@@ -373,7 +372,6 @@ func TestParseTopics(t *testing.T) {
373372
tests := setupTopicsTests()
374373

375374
for _, tt := range tests {
376-
tt := tt
377375
t.Run(tt.name, func(t *testing.T) {
378376
t.Parallel()
379377
createObj := tt.args.createObj()
@@ -393,7 +391,6 @@ func TestParseTopicsIntoMap(t *testing.T) {
393391
tests := setupTopicsTests()
394392

395393
for _, tt := range tests {
396-
tt := tt
397394
t.Run(tt.name, func(t *testing.T) {
398395
t.Parallel()
399396
outMap := make(map[string]interface{})

accounts/abi/unpack_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ func TestMethodMultiReturn(t *testing.T) {
389389
"Can not unpack into a slice with wrong types",
390390
}}
391391
for _, tc := range testCases {
392-
tc := tc
393392
t.Run(tc.name, func(t *testing.T) {
394393
require := require.New(t)
395394
err := abi.UnpackIntoInterface(tc.dest, "multi", data)

0 commit comments

Comments
 (0)