1
0
mirror of https://github.com/golang/go synced 2024-11-20 09:44:45 -07:00

time: simplify: tell people to not use == with Time values

Change-Id: I49952f89b04f41109bb6591c6f025971d9880123
Reviewed-on: https://go-review.googlesource.com/32411
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Symonds <dsymonds@golang.org>
This commit is contained in:
Ian Lance Taylor 2016-10-30 11:56:19 -04:00
parent d89ab1398e
commit 2c5bce1cfa

View File

@ -75,7 +75,7 @@ func (t Time) Before(u Time) bool {
// Equal reports whether t and u represent the same time instant.
// Two times can be equal even if they are in different locations.
// For example, 6:00 +0200 CEST and 4:00 UTC are Equal.
// Note that using == with Time values produces unpredictable results.
// Do not use == with Time values.
func (t Time) Equal(u Time) bool {
return t.sec == u.sec && t.nsec == u.nsec
}