1
0
mirror of https://github.com/golang/go synced 2024-11-18 08:44:43 -07:00

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 <r@golang.org>
This commit is contained in:
Brad Fitzpatrick 2017-06-14 21:39:28 +00:00
parent cabf622da8
commit 862e45d49d

View File

@ -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,