Skip to content

Commit 5ec99f8

Browse files
author
Bryan C. Mills
committed
xerrors: avoid infinite loop in test (detailed).Error method
Fixes golang/go#40536 Change-Id: I5daaec48301cdedb2efcfadaf1dcd41cb8e96b01 Reviewed-on: https://go-review.googlesource.com/c/xerrors/+/246640 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Alexander Rakoczy <[email protected]>
1 parent 9bdfabe commit 5ec99f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fmt_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ var _ xerrors.Formatter = detailed{}
395395

396396
type detailed struct{}
397397

398-
func (e detailed) Error() string { return fmt.Sprint(e) }
398+
func (e detailed) Error() string { panic("should have called FormatError") }
399399

400400
func (detailed) FormatError(p xerrors.Printer) (next error) {
401401
p.Printf("out of %s", "peanuts")

0 commit comments

Comments
 (0)