From a0f1b97ee702d4ee4674572c9b1b9edf4750903a Mon Sep 17 00:00:00 2001 From: Chirag <56735482+Chirag018@users.noreply.github.com> Date: Mon, 1 May 2023 08:06:22 +0530 Subject: [PATCH] Refactor variable name from len to length (#1675) I have made some changes to the code in this pull request. The main change is that I have renamed the variable `len` to `length`. This is because `len` is a built-in function in Go, and using it as a variable name can cause confusion and potential issues down the line. It is best practice to use a different name, and `length` is a clear and descriptive alternative. --- pkg/shares/share_builder_test.go | 4 ++-- pkg/shares/shares_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/shares/share_builder_test.go b/pkg/shares/share_builder_test.go index 8696e4d22c..e0a7663c9d 100644 --- a/pkg/shares/share_builder_test.go +++ b/pkg/shares/share_builder_test.go @@ -142,10 +142,10 @@ func TestShareBuilderWriteSequenceLen(t *testing.T) { share, err := tc.builder.Build() require.NoError(t, err) - len, err := share.SequenceLen() + length, err := share.SequenceLen() require.NoError(t, err) - assert.Equal(t, tc.wantLen, len) + assert.Equal(t, tc.wantLen, length) }) } } diff --git a/pkg/shares/shares_test.go b/pkg/shares/shares_test.go index ca5e37c7e3..1c59a930a7 100644 --- a/pkg/shares/shares_test.go +++ b/pkg/shares/shares_test.go @@ -117,14 +117,14 @@ func TestSequenceLen(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - len, err := tc.share.SequenceLen() + length, err := tc.share.SequenceLen() if tc.wantErr { assert.Error(t, err) return } - if tc.wantLen != len { - t.Errorf("want %d, got %d", tc.wantLen, len) + if tc.wantLen != length { + t.Errorf("want %d, got %d", tc.wantLen, length) } }) }