From 7357bfdcd29ed1dc1719c9436b5d5420020610ee Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Fri, 16 Nov 2018 02:20:35 +0000 Subject: [PATCH] Feedback from @bradfitz --- src/testing/testing.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/testing/testing.go b/src/testing/testing.go index da52ba8edf..0ac51b6fe5 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -18,11 +18,11 @@ // For more detail, run ``go help test'' and ``go help testflag''. // // A simple test function looks like this: +// // func TestAbs(t *testing.T) { // got := Abs(-1) -// want := 1 -// if got != want { -// t.Errorf("Abs(-1) returns %d, want %d", got, want) +// if got != 1 { +// t.Errorf("Abs(-1) = %d; want 1", got) // } // } // @@ -36,7 +36,7 @@ // For a description of the testing flags, see // https://golang.org/cmd/go/#hdr-Testing_flags // -// A simple benchmark function looks like this: +// A sample benchmark function looks like this: // func BenchmarkHello(b *testing.B) { // for i := 0; i < b.N; i++ { // fmt.Sprintf("hello") @@ -136,6 +136,7 @@ // // Tests or benchmarks may be skipped at run time with a call to // the Skip method of *T or *B: +// // func TestTimeConsuming(t *testing.T) { // if testing.Short() { // t.Skip("skipping test in short mode.")