From 862e45d49d07ab1cdf79763763cc29ed6d311a20 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 14 Jun 2017 21:39:28 +0000 Subject: [PATCH] time: remove some redundant equality comparison documentation Updates to CL 45698 Updates #19510 Change-Id: Iec7a455b6c4d5f96d0b674459bf1455c99102d62 Reviewed-on: https://go-review.googlesource.com/45779 Reviewed-by: Rob Pike --- src/time/time.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/time/time.go b/src/time/time.go index bd65546bb2..3f13e3431c 100644 --- a/src/time/time.go +++ b/src/time/time.go @@ -60,15 +60,10 @@ // t.UnmarshalJSON, and t.UnmarshalText always create times with // no monotonic clock reading. // -// Note that the Go == operator compares not just the time instant but also -// the Location and the monotonic clock reading. If time values returned -// from time.Now and time values constructed by other means (for example, -// by time.Parse or time.Unix) are meant to compare equal when used as map -// keys, the times returned by time.Now must have the monotonic clock -// reading stripped, by setting t = t.Round(0). In general, prefer -// t.Equal(u) to t == u, since t.Equal uses the most accurate comparison -// available and correctly handles the case when only one of its arguments -// has a monotonic clock reading. +// Note that the Go == operator compares not just the time instant but +// also the Location and the monotonic clock reading. See the +// documentation for the Time type for a discussion of equality +// testing for Time values. // // For debugging, the result of t.String does include the monotonic // clock reading if present. If t != u because of different monotonic clock readings, -- 2.50.0