From aa5de9ebb55bbd5e0a38304f8f8e603b2ec03238 Mon Sep 17 00:00:00 2001 From: Christian Hoeppner Date: Fri, 4 Jul 2025 18:40:42 +0000 Subject: synctest: fix comments for time.Now() in synctests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also add a test case to make sure that time.Now() results in the documented date. Change-Id: Ic4cc577eba485b7c6e1a64122da06d7075bbe12e Reviewed-on: https://go-review.googlesource.com/c/go/+/685677 LUCI-TryBot-Result: Go LUCI Auto-Submit: Christian Höppner Reviewed-by: Damien Neil --- src/testing/synctest/example_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/testing/synctest/example_test.go') diff --git a/src/testing/synctest/example_test.go b/src/testing/synctest/example_test.go index 9ecd28d3dd..843377ea88 100644 --- a/src/testing/synctest/example_test.go +++ b/src/testing/synctest/example_test.go @@ -21,7 +21,7 @@ import ( func TestTime(t *testing.T) { synctest.Test(t, func(t *testing.T) { - start := time.Now() // always midnight UTC 2001-01-01 + start := time.Now() // always midnight UTC 2000-01-01 go func() { time.Sleep(1 * time.Nanosecond) t.Log(time.Since(start)) // always logs "1ns" -- cgit v1.3