Skip to content

Commit 265ff50

Browse files
authored
refactor: use a more modern writing style (#2534)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview Optimize code using a more modern writing style. Official support from Go, for more details visit https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize. <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> --> Signed-off-by: queryfast <[email protected]>
1 parent 1453b0a commit 265ff50

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

block/sync_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ func TestSyncLoop_MultipleHeadersArriveFirst_ThenData(t *testing.T) {
843843
txs[i] = append(txs[i], tx)
844844
}
845845

846-
expectedAppHashes[i] = []byte(fmt.Sprintf("app_hash_h%d", i+1))
846+
expectedAppHashes[i] = fmt.Appendf(nil, "app_hash_h%d", i+1)
847847
var err error
848848
expectedStates[i], err = prevState.NextState(headers[i].Header, expectedAppHashes[i])
849849
require.NoError(err)

pkg/store/store_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ func TestHeightErrors(t *testing.T) {
272272
_ = cases[1].mock.Put(context.Background(), ds.NewKey(getHeightKey()), badHeightBytes)
273273

274274
for _, tc := range cases {
275-
tc := tc
276275
t.Run(tc.name, func(t *testing.T) {
277276
t.Parallel()
278277
s := New(tc.mock)

0 commit comments

Comments
 (0)