From 38f2b431234f51f202a2b1cad26017de2c3dc00f Mon Sep 17 00:00:00 2001 From: Tom Fleet Date: Thu, 18 Jan 2024 14:31:56 +0000 Subject: [PATCH] Describe error case in function doc comment --- test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test.go b/test.go index 25d8d34..604ec63 100644 --- a/test.go +++ b/test.go @@ -219,6 +219,10 @@ func File(t testing.TB, file, want string) { // CaptureOutput captures and returns data printed to stdout and stderr by the provided function fn, allowing // you to test functions that write to those streams and do not have an option to pass in an [io.Writer]. // +// If the provided function returns a non nil error, the test is failed with the error logged as the reason. +// +// If any error occurs capturing stdout or stderr, the test will also be failed with a descriptive log. +// // fn := func() error { // fmt.Println("hello stdout") // return nil