Skip to content

Commit 42f5ee4

Browse files
committed
testing: mention in docs for Logf that a final newline is added if needed
Fixes #16423 Change-Id: I9635db295be4d356d427adadd309084e16c4582f Reviewed-on: https://go-review.googlesource.com/31255 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent ca28620 commit 42f5ee4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/testing/testing.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,11 @@ func (c *common) log(s string) {
476476
// printed to avoid having performance depend on the value of the -test.v flag.
477477
func (c *common) Log(args ...interface{}) { c.log(fmt.Sprintln(args...)) }
478478

479-
// Logf formats its arguments according to the format, analogous to Printf,
480-
// and records the text in the error log. For tests, the text will be printed only if
481-
// the test fails or the -test.v flag is set. For benchmarks, the text is always
482-
// printed to avoid having performance depend on the value of the -test.v flag.
479+
// Logf formats its arguments according to the format, analogous to Printf, and
480+
// records the text in the error log. A final newline is added if not provided. For
481+
// tests, the text will be printed only if the test fails or the -test.v flag is
482+
// set. For benchmarks, the text is always printed to avoid having performance
483+
// depend on the value of the -test.v flag.
483484
func (c *common) Logf(format string, args ...interface{}) { c.log(fmt.Sprintf(format, args...)) }
484485

485486
// Error is equivalent to Log followed by Fail.

0 commit comments

Comments
 (0)