Skip to content

Commit 9392aef

Browse files
committed
* removed loop-variable copy - The loop variable scope has been fixed since go 1.22.
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
1 parent 2e29972 commit 9392aef

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

loadgen/client_test.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ var defaultLimits = []*adapters.GenerateLimit{
4747
func TestLoadGenForLoadGen(t *testing.T) {
4848
t.Parallel()
4949
for _, mode := range test.ServerModes {
50-
mode := mode
5150
t.Run(fmt.Sprintf("tls-mode:%s", mode), func(t *testing.T) {
5251
t.Parallel()
5352
serverCreds, clientCreds := createServerAndClientTLSCerts(t, mode)
5453
for _, limit := range defaultLimits {
55-
limit := limit
5654
t.Run(limitToString(limit), func(t *testing.T) {
5755
t.Parallel()
5856
clientConf := DefaultClientConf()
@@ -86,12 +84,10 @@ func TestLoadGenForLoadGen(t *testing.T) {
8684
func TestLoadGenForVCService(t *testing.T) {
8785
t.Parallel()
8886
for _, mode := range test.ServerModes {
89-
mode := mode
9087
t.Run(fmt.Sprintf("tls-mode:%s", mode), func(t *testing.T) {
9188
t.Parallel()
9289
serverCreds, clientCreds := createServerAndClientTLSCerts(t, mode)
9390
for _, limit := range defaultLimits {
94-
limit := limit
9591
t.Run(limitToString(limit), func(t *testing.T) {
9692
t.Parallel()
9793
clientConf := DefaultClientConf()
@@ -108,12 +104,10 @@ func TestLoadGenForVCService(t *testing.T) {
108104
func TestLoadGenForSigVerifier(t *testing.T) {
109105
t.Parallel()
110106
for _, mode := range test.ServerModes {
111-
mode := mode
112107
t.Run(fmt.Sprintf("tls-mode:%s", mode), func(t *testing.T) {
113108
t.Parallel()
114109
serverCreds, clientCreds := createServerAndClientTLSCerts(t, mode)
115110
for _, limit := range defaultLimits {
116-
limit := limit
117111
t.Run(limitToString(limit), func(t *testing.T) {
118112
t.Parallel()
119113
clientConf := DefaultClientConf()
@@ -151,7 +145,6 @@ func startVerifiers(t *testing.T, serverCreds, clientCreds connection.TLSConfig)
151145
func TestLoadGenForCoordinator(t *testing.T) {
152146
t.Parallel()
153147
for _, mode := range test.ServerModes {
154-
mode := mode
155148
t.Run(fmt.Sprintf("tls-mode:%s", mode), func(t *testing.T) {
156149
t.Parallel()
157150
serverCreds, clientCreds := createServerAndClientTLSCerts(t, mode)
@@ -162,7 +155,6 @@ func TestLoadGenForCoordinator(t *testing.T) {
162155
Transactions: 5*defaultBlockSize + 2, // +2 for the config and meta namespace TXs.
163156
},
164157
) {
165-
limit := limit
166158
t.Run(limitToString(limit), func(t *testing.T) {
167159
t.Parallel()
168160
clientConf := DefaultClientConf()
@@ -197,7 +189,6 @@ func TestLoadGenForCoordinator(t *testing.T) {
197189
func TestLoadGenForSidecar(t *testing.T) {
198190
t.Parallel()
199191
for _, mode := range test.ServerModes {
200-
mode := mode
201192
t.Run(fmt.Sprintf("tls-mode:%s", mode), func(t *testing.T) {
202193
t.Parallel()
203194
serverCreds, clientCreds := createServerAndClientTLSCerts(t, mode)
@@ -206,7 +197,6 @@ func TestLoadGenForSidecar(t *testing.T) {
206197
&adapters.GenerateLimit{Blocks: 5},
207198
&adapters.GenerateLimit{Transactions: 5*defaultBlockSize + 1}, // +1 for the meta namespace TX.
208199
) {
209-
limit := limit
210200
t.Run(limitToString(limit), func(t *testing.T) {
211201
t.Parallel()
212202
clientConf := DefaultClientConf()
@@ -264,7 +254,6 @@ func TestLoadGenForSidecar(t *testing.T) {
264254
func TestLoadGenForOrderer(t *testing.T) {
265255
t.Parallel()
266256
for _, limit := range defaultLimits {
267-
limit := limit
268257
t.Run(limitToString(limit), func(t *testing.T) {
269258
t.Parallel()
270259
clientConf := DefaultClientConf()
@@ -457,7 +446,8 @@ func limitToString(m *adapters.GenerateLimit) string {
457446
return strings.Join(out, ",")
458447
}
459448

460-
// createServerAndClientTLSCerts creates a tls configuration using the credential factory.
449+
// createServerAndClientTLSCerts creates tls configurations for
450+
// both the server and client.
461451
func createServerAndClientTLSCerts(t *testing.T, tlsMode string) (
462452
serverCreds, clientCreds connection.TLSConfig,
463453
) {

0 commit comments

Comments
 (0)