errors/fmt: fix tests for new panic message in Go 1.14

Fixes golang/go#30622.

Change-Id: Ia99d06914aeffb219aaf54afe0f66e573a595e63
Reviewed-on: https://go-review.googlesource.com/c/exp/+/204078
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/errors/fmt/fmt_test.go b/errors/fmt/fmt_test.go
index 17d7fce..a1a539b 100644
--- a/errors/fmt/fmt_test.go
+++ b/errors/fmt/fmt_test.go
@@ -1678,12 +1678,19 @@
 	{"%s", PanicF{3}, "%!s(PANIC=3)"},
 }
 
+var stripMethod = strings.NewReplacer(
+	"PANIC=String method: ", "PANIC=",
+	"PANIC=GoString method: ", "PANIC=",
+	"PANIC=Format method: ", "PANIC=",
+)
+
 func TestPanics(t *testing.T) {
 	if os.Getenv("GO_BUILDER_NAME") != "" {
 		t.Skipf("skipping broken test on builders; see https://golang.org/issue/30622")
 	}
 	for i, tt := range panictests {
 		s := Sprintf(tt.fmt, tt.in)
+		s = stripMethod.Replace(s)
 		if s != tt.out {
 			t.Errorf("%d: %q: got %q expected %q", i, tt.fmt, s, tt.out)
 		}