do not use error directive

This commit is contained in:
Shreyas Goenka 2024-12-09 13:03:59 +05:30
parent 6f340a46ea
commit 8aa088c404
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
1 changed files with 3 additions and 3 deletions

View File

@ -364,7 +364,7 @@ func readFile(t *testing.T, name string) string {
// stored in ./testdata. This are debugging logs to help diagnose the issue // stored in ./testdata. This are debugging logs to help diagnose the issue
// when it occurs again. // when it occurs again.
origErr := err origErr := err
t.Logf("Error reading file %s: %w", name, err) t.Logf("Error reading file %s: %s", name, err)
err := filepath.Walk(".", func(path string, info fs.FileInfo, err error) error { err := filepath.Walk(".", func(path string, info fs.FileInfo, err error) error {
if info.IsDir() { if info.IsDir() {
t.Logf("Found directory: %s", path) t.Logf("Found directory: %s", path)
@ -374,9 +374,9 @@ func readFile(t *testing.T, name string) string {
return nil return nil
}) })
if err != nil { if err != nil {
t.Logf("Error walking directory: %w", err) t.Logf("Error walking directory: %s", err)
} }
t.Fatalf("Ending test because of failure to read file %s: %w", name, origErr) t.Fatalf("Ending test because of failure to read file %s: %s", name, origErr)
return "" return ""
} }
} }