diff options
| author | Rob Pike <r@golang.org> | 2016-10-16 11:28:45 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2016-10-16 22:29:55 +0000 |
| commit | 42f5ee4cbf15ff02803863d1002259565da0f071 (patch) | |
| tree | b7585f6be6c41300a5a92e1e3cd671e2b1389a68 /src/testing/testing.go | |
| parent | ca28620db9392d5aa1002256e41bd066f0cc6377 (diff) | |
| download | go-42f5ee4cbf15ff02803863d1002259565da0f071.tar.xz | |
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 <iant@golang.org>
Diffstat (limited to 'src/testing/testing.go')
| -rw-r--r-- | src/testing/testing.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go index e2350ebc06..0646108c66 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -476,10 +476,11 @@ func (c *common) log(s string) { // printed to avoid having performance depend on the value of the -test.v flag. func (c *common) Log(args ...interface{}) { c.log(fmt.Sprintln(args...)) } -// Logf formats its arguments according to the format, analogous to Printf, -// and records the text in the error log. For tests, the text will be printed only if -// the test fails or the -test.v flag is set. For benchmarks, the text is always -// printed to avoid having performance depend on the value of the -test.v flag. +// Logf formats its arguments according to the format, analogous to Printf, and +// records the text in the error log. A final newline is added if not provided. For +// tests, the text will be printed only if the test fails or the -test.v flag is +// set. For benchmarks, the text is always printed to avoid having performance +// depend on the value of the -test.v flag. func (c *common) Logf(format string, args ...interface{}) { c.log(fmt.Sprintf(format, args...)) } // Error is equivalent to Log followed by Fail. |
