From 3848b44c754229125195e2f95bb71868d1a36f56 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 31 Oct 2022 13:41:59 -0700 Subject: [PATCH] os: in TestDirFS only check returned path for unexpected string The test added in CL 446115 was failing on Plan 9, on which the error returned by a failed open includes the path that failed. Change-Id: If27222596c3cb0366a030bb49ae41c4c869c3db2 Reviewed-on: https://go-review.googlesource.com/c/go/+/446641 Reviewed-by: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Reviewed-by: David du Colombier <0intro@gmail.com> Run-TryBot: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor --- src/os/os_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/os_test.go b/src/os/os_test.go index 52fac4f63c..a1b954c438 100644 --- a/src/os/os_test.go +++ b/src/os/os_test.go @@ -2727,7 +2727,7 @@ func TestDirFS(t *testing.T) { if !strings.Contains(err.Error(), nonesuch) { t.Errorf("error %q does not contain %q", err, nonesuch) } - if strings.Contains(err.Error(), "testdata") { + if strings.Contains(err.(*PathError).Path, "testdata") { t.Errorf("error %q contains %q", err, "testdata") } } -- 2.48.1