build: address 'copyloopvar' linter warning

golangci-lint reports these:

    The copy of the 'for' variable "kmsID" can be deleted (Go 1.22+)
    (copyloopvar)

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos
2024-04-26 10:35:01 +02:00
committed by mergify[bot]
parent 9321fe03c3
commit 0e7b06e9d0
24 changed files with 197 additions and 259 deletions

View File

@ -71,7 +71,6 @@ func TestValidateSchedulingInterval(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
err := validateSchedulingInterval(tt.interval)
@ -147,7 +146,6 @@ func TestValidateSchedulingDetails(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
err := validateSchedulingDetails(ctx, tt.parameters)
@ -203,7 +201,6 @@ func TestGetSchedulingDetails(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
interval, startTime := getSchedulingDetails(tt.parameters)
@ -251,11 +248,10 @@ func TestCheckVolumeResyncStatus(t *testing.T) {
},
}
for _, tt := range tests {
ts := tt
t.Run(ts.name, func(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if err := checkVolumeResyncStatus(ctx, ts.args); (err != nil) != ts.wantErr {
t.Errorf("checkVolumeResyncStatus() error = %v, expect error = %v", err, ts.wantErr)
if err := checkVolumeResyncStatus(ctx, tt.args); (err != nil) != tt.wantErr {
t.Errorf("checkVolumeResyncStatus() error = %v, expect error = %v", err, tt.wantErr)
}
})
}
@ -388,11 +384,10 @@ func TestCheckRemoteSiteStatus(t *testing.T) {
},
}
for _, tt := range tests {
ts := tt
t.Run(ts.name, func(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if ready := checkRemoteSiteStatus(context.TODO(), &ts.args); ready != ts.wantReady {
t.Errorf("checkRemoteSiteStatus() ready = %v, expect ready = %v", ready, ts.wantReady)
if ready := checkRemoteSiteStatus(context.TODO(), &tt.args); ready != tt.wantReady {
t.Errorf("checkRemoteSiteStatus() ready = %v, expect ready = %v", ready, tt.wantReady)
}
})
}
@ -501,7 +496,6 @@ func TestValidateLastSyncInfo(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
teststruct, err := getLastSyncInfo(ctx, tt.description)
@ -600,7 +594,6 @@ func TestGetGRPCError(t *testing.T) {
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
result := getGRPCError(tt.err)
@ -656,7 +649,6 @@ func Test_timestampFromString(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
got, err := timestampFromString(tt.timestamp)