mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
time: fix receiver for Time.IsDST method
Only methods that modify the time take pointer receivers; IsDST does not modify it and therefore should not. For #42102 and #46688. Change-Id: I4721ef7f4d7572236ae6e4d99a459b9ffb11999e Reviewed-on: https://go-review.googlesource.com/c/go/+/326789 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
881b6ea7ba
commit
b0355a3e72
2 changed files with 2 additions and 2 deletions
|
|
@ -153,7 +153,7 @@ pkg time, const Layout = "01/02 03:04:05PM '06 -0700"
|
||||||
pkg time, const Layout ideal-string
|
pkg time, const Layout ideal-string
|
||||||
pkg time, func UnixMicro(int64) Time
|
pkg time, func UnixMicro(int64) Time
|
||||||
pkg time, func UnixMilli(int64) Time
|
pkg time, func UnixMilli(int64) Time
|
||||||
pkg time, method (*Time) IsDST() bool
|
pkg time, method (Time) IsDST() bool
|
||||||
pkg time, method (Time) GoString() string
|
pkg time, method (Time) GoString() string
|
||||||
pkg time, method (Time) UnixMicro() int64
|
pkg time, method (Time) UnixMicro() int64
|
||||||
pkg time, method (Time) UnixMilli() int64
|
pkg time, method (Time) UnixMilli() int64
|
||||||
|
|
|
||||||
|
|
@ -1340,7 +1340,7 @@ func UnixMicro(usec int64) Time {
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsDST reports whether the time in the configured location is in Daylight Savings Time.
|
// IsDST reports whether the time in the configured location is in Daylight Savings Time.
|
||||||
func (t *Time) IsDST() bool {
|
func (t Time) IsDST() bool {
|
||||||
_, _, _, _, isDST := t.loc.lookup(t.Unix())
|
_, _, _, _, isDST := t.loc.lookup(t.Unix())
|
||||||
return isDST
|
return isDST
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue