Skip to content

Commit

Permalink
Describe error case in function doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
FollowTheProcess committed Jan 18, 2024
1 parent f676e73 commit 38f2b43
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38f2b43

Please sign in to comment.