Skip to content

Commit 71acf3d

Browse files
Robert-André Mauchindiscordianfish
authored andcommitted
Convert %w verb in t.Errorf function to %v
Go 1.18 introduced a change where only fmt.Errorf function accepts the %w verb. Other Errorf function like t.Errorf do not accept it anymore. See golang/go#47641 Fix: #430 Signed-off-by: Robert-André Mauchin <[email protected]>
1 parent fbe360a commit 71acf3d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mountstats_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ func TestMountStats(t *testing.T) {
393393
t.Error("expected an error, but none occurred")
394394
}
395395
if !tt.invalid && err != nil {
396-
t.Errorf("unexpected error: %w", err)
396+
t.Errorf("unexpected error: %v", err)
397397
}
398398

399399
if want, have := tt.mounts, mounts; !reflect.DeepEqual(want, have) {
@@ -434,7 +434,7 @@ func TestMountStatsExtendedOperationStats(t *testing.T) {
434434
r := strings.NewReader(extendedOpsExampleMountstats)
435435
_, err := parseMountStats(r)
436436
if err != nil {
437-
t.Errorf("failed to parse mount stats with extended per-op statistics: %w", err)
437+
t.Errorf("failed to parse mount stats with extended per-op statistics: %v", err)
438438
}
439439
}
440440

swaps_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func TestParseSwapString(t *testing.T) {
102102
t.Error("unexpected success")
103103
}
104104
if !tt.invalid && err != nil {
105-
t.Errorf("unexpected error: %w", err)
105+
t.Errorf("unexpected error: %v", err)
106106
}
107107

108108
if !reflect.DeepEqual(tt.swap, swap) {

0 commit comments

Comments
 (0)