diff --git a/cmd/peer/main_test.go b/cmd/peer/main_test.go index d20869f717a..4a1f519ad21 100644 --- a/cmd/peer/main_test.go +++ b/cmd/peer/main_test.go @@ -57,7 +57,6 @@ func TestPluginLoadingFailure(t *testing.T) { "ENDORSERS_ESCC", "VALIDATORS_VSCC", } { - plugin := plugin t.Run(plugin, func(t *testing.T) { cmd := exec.Command(peer, "node", "start") cmd.Env = []string{ diff --git a/core/cclifecycle/util_test.go b/core/cclifecycle/util_test.go index 7ebe15a7ce0..90b7cbe384b 100644 --- a/core/cclifecycle/util_test.go +++ b/core/cclifecycle/util_test.go @@ -119,7 +119,6 @@ func TestChaincodeInspection(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.name, func(t *testing.T) { query := &mocks.Query{} query.On("Done") diff --git a/core/chaincode/lifecycle/lifecycle_test.go b/core/chaincode/lifecycle/lifecycle_test.go index 35396f4b815..4aa65dc64e1 100644 --- a/core/chaincode/lifecycle/lifecycle_test.go +++ b/core/chaincode/lifecycle/lifecycle_test.go @@ -1011,7 +1011,6 @@ var _ = Describe("ExternalFunctions", func() { fakeOrg1State, } for i, kvs := range []MapLedgerShim{org0KVS, org1KVS} { - kvs := kvs fakeOrgStates[i].GetStateStub = kvs.GetState fakeOrgStates[i].GetStateHashStub = kvs.GetStateHash fakeOrgStates[i].PutStateStub = kvs.PutState @@ -1181,7 +1180,6 @@ var _ = Describe("ExternalFunctions", func() { fakeOrg1State, } for i, kvs := range []MapLedgerShim{org0KVS, org1KVS} { - kvs := kvs fakeOrgStates[i].GetStateStub = kvs.GetState fakeOrgStates[i].GetStateHashStub = kvs.GetStateHash fakeOrgStates[i].PutStateStub = kvs.PutState @@ -1472,7 +1470,6 @@ var _ = Describe("ExternalFunctions", func() { fakeOrg1State, } for i, kvs := range []MapLedgerShim{org0KVS, org1KVS} { - kvs := kvs fakeOrgStates[i].GetStateStub = kvs.GetState fakeOrgStates[i].GetStateHashStub = kvs.GetStateHash fakeOrgStates[i].PutStateStub = kvs.PutState @@ -1605,7 +1602,6 @@ var _ = Describe("ExternalFunctions", func() { fakeOrg1State, } for i, kvs := range []MapLedgerShim{org0KVS, org1KVS} { - kvs := kvs fakeOrgStates[i].GetStateStub = kvs.GetState fakeOrgStates[i].GetStateHashStub = kvs.GetStateHash fakeOrgStates[i].PutStateStub = kvs.PutState @@ -1794,7 +1790,6 @@ var _ = Describe("ExternalFunctions", func() { fakeOrg1State, } for i, kvs := range []MapLedgerShim{org0KVS, org1KVS} { - kvs := kvs fakeOrgStates[i].GetStateStub = kvs.GetState fakeOrgStates[i].GetStateHashStub = kvs.GetStateHash fakeOrgStates[i].PutStateStub = kvs.PutState @@ -1891,7 +1886,6 @@ var _ = Describe("ExternalFunctions", func() { fakeOrg1State, } for i, kvs := range []MapLedgerShim{org0KVS, org1KVS} { - kvs := kvs fakeOrgStates[i].GetStateStub = kvs.GetState fakeOrgStates[i].GetStateHashStub = kvs.GetStateHash fakeOrgStates[i].PutStateStub = kvs.PutState diff --git a/core/common/ccprovider/ccprovider_test.go b/core/common/ccprovider/ccprovider_test.go index 42a4c6fe206..f49ecd79dc6 100644 --- a/core/common/ccprovider/ccprovider_test.go +++ b/core/common/ccprovider/ccprovider_test.go @@ -92,7 +92,6 @@ func TestInstalledCCs(t *testing.T) { _ = testCases for _, test := range testCases { - test := test t.Run(test.name, func(t *testing.T) { c := &ccprovider.CCInfoFSImpl{GetHasher: cryptoProvider} res, err := c.ListInstalledChaincodes(path.Join(tmpDir, test.directory), test.ls, test.extractCCFromPath) diff --git a/core/peer/config_test.go b/core/peer/config_test.go index a2d28cba476..2ec2badfc82 100644 --- a/core/peer/config_test.go +++ b/core/peer/config_test.go @@ -82,7 +82,6 @@ func TestPeerAddress(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.name, func(t *testing.T) { for k, v := range test.settings { viper.Set(k, v) diff --git a/core/peer/pkg_test.go b/core/peer/pkg_test.go index 99f7e52aead..cbb97e1d18f 100644 --- a/core/peer/pkg_test.go +++ b/core/peer/pkg_test.go @@ -257,7 +257,6 @@ func TestUpdateRootsFromConfigBlock(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.name, func(t *testing.T) { server, err := comm.NewGRPCServer("localhost:0", test.serverConfig) require.NoError(t, err, "failed to create gRPC server") diff --git a/discovery/client/selection_test.go b/discovery/client/selection_test.go index 5d413537b25..e42335f008a 100644 --- a/discovery/client/selection_test.go +++ b/discovery/client/selection_test.go @@ -133,7 +133,6 @@ func TestPrioritiesByHeight(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.name, func(t *testing.T) { s1 := stateInfoWithHeight(test.leftHeight) s2 := stateInfoWithHeight(test.rightHeight) diff --git a/discovery/support/acl/support_test.go b/discovery/support/acl/support_test.go index 12fdbe5e216..14743e6a341 100644 --- a/discovery/support/acl/support_test.go +++ b/discovery/support/acl/support_test.go @@ -60,7 +60,6 @@ func TestConfigSequence(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.name, func(t *testing.T) { chConfig := &mocks.ChannelConfigGetter{} r := &mocks.Resources{} @@ -161,7 +160,6 @@ func TestSatisfiesPrincipal(t *testing.T) { sup := acl.NewDiscoverySupport(&mocks.Verifier{}, &mocks.Evaluator{}, chConfig) for _, test := range tests { - test := test t.Run(test.testDescription, func(t *testing.T) { test.before() err := sup.SatisfiesPrincipal("mychannel", nil, nil) diff --git a/discovery/support/chaincode/support_test.go b/discovery/support/chaincode/support_test.go index b144febc7d3..8cb95e0ad41 100644 --- a/discovery/support/chaincode/support_test.go +++ b/discovery/support/chaincode/support_test.go @@ -82,7 +82,6 @@ func TestSupport(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.name, func(t *testing.T) { sup := NewDiscoverySupport(&mockMetadataRetriever{res: test.input}) res := sup.PoliciesByChaincode("", "", test.collNames...) diff --git a/discovery/support/config/support_test.go b/discovery/support/config/support_test.go index e3daa5be5e9..2716513d4a7 100644 --- a/discovery/support/config/support_test.go +++ b/discovery/support/config/support_test.go @@ -221,7 +221,6 @@ func TestValidateConfig(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.name, func(t *testing.T) { err := config.ValidateConfig(test.config) require.Contains(t, test.containsError, err.Error())