Remove unnecessary copies of loop variables (#28138)

Этот коммит содержится в:
Ben Schumacher
2024-09-11 16:51:30 +02:00
коммит произвёл GitHub
родитель b6bd92f90e
Коммит d9e47522a0
13 изменённых файлов: 0 добавлений и 24 удалений

Просмотреть файл

@@ -2493,7 +2493,6 @@ func TestIsCRTEnabledForUser(t *testing.T) {
}
for _, tc := range testCases {
tc := tc
t.Run(tc.desc, func(t *testing.T) {
th := SetupWithStoreMock(t)
defer th.TearDown()

Просмотреть файл

@@ -57,8 +57,6 @@ func TestMetricsRouter(t *testing.T) {
"pprof trace": {path: "/debug/pprof/trace"},
} {
t.Run(name, func(t *testing.T) {
name := name // TODO: Remove once go1.22 is used
tc := tc // TODO: Remove once go1.22 is used
t.Parallel()
method := http.MethodGet

Просмотреть файл

@@ -1472,7 +1472,6 @@ func TestGetEmojiNamesForString(t *testing.T) {
}
for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.Description, func(t *testing.T) {
emojis := getEmojiNamesForString(testCase.Input)
assert.ElementsMatch(t, emojis, testCase.Expected, "received incorrect emoji names")
@@ -1568,7 +1567,6 @@ func TestGetEmojiNamesForPost(t *testing.T) {
}
for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.Description, func(t *testing.T) {
emojis := getEmojiNamesForPost(testCase.Post, testCase.Reactions)
assert.ElementsMatch(t, emojis, testCase.Expected, "received incorrect emoji names")
@@ -2829,7 +2827,6 @@ func TestContainsPermalink(t *testing.T) {
}
for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.Description, func(t *testing.T) {
actual := th.App.containsPermalink(th.Context, testCase.Post)
assert.Equal(t, testCase.Expected, actual)

Просмотреть файл

@@ -757,7 +757,6 @@ func TestMaxPostSize(t *testing.T) {
}
for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.Description, func(t *testing.T) {
mockStore := &storetest.Store{}
defer mockStore.AssertExpectations(t)