Skip to content

Commit e57edab

Browse files
Fix range variable in archiver_test not being captured (#3724)
1 parent b572419 commit e57edab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

service/history/archival/archiver_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ package archival
2727
import (
2828
"context"
2929
"errors"
30-
"fmt"
3130
"testing"
3231

3332
"github.com/golang/mock/gomock"
@@ -244,6 +243,7 @@ func TestArchiver(t *testing.T) {
244243
},
245244
},
246245
} {
246+
c := c // capture range variable
247247
t.Run(c.Name, func(t *testing.T) {
248248
t.Parallel()
249249
ctx := context.Background()
@@ -324,9 +324,9 @@ func (r *errorLogRecorder) Error(msg string, tags ...tag.Tag) {
324324
for _, t := range tags {
325325
if t.Key() == "error" {
326326
value := t.Value()
327-
message, ok := value.(fmt.Stringer)
327+
message, ok := value.(string)
328328
require.True(r.T, ok)
329-
r.ErrorMessages = append(r.ErrorMessages, message.String())
329+
r.ErrorMessages = append(r.ErrorMessages, message)
330330
}
331331
}
332332
}

0 commit comments

Comments
 (0)