You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Please answer these questions before submitting your issue. Thanks!
437func (tTime) abs() uint64 {
438l:=t.loc439// Avoid function calls when possible.440ifl==nil||l==&localLoc {
441l=l.get()
442 }
443sec:=t.sec+internalToUnix444ifl!=&utcLoc {
445ifl.cacheZone!=nil&&l.cacheStart<=sec&&sec< l.cacheEnd {
446sec+=int64(l.cacheZone.offset)
447 } else {
448_, offset, _, _, _:=l.lookup(sec)
449sec+=int64(offset)
450 }
451 }
452returnuint64(sec+ (unixToInternal+internalToAbsolute))
453 }
454455// locabs is a combination of the Zone and abs methods,456// extracting both return values from a single zone lookup.457func (tTime) locabs() (namestring, offsetint, absuint64) {
458l:=t.loc459ifl==nil||l==&localLoc {
460l=l.get()
461 }
462// Avoid function call if we hit the local time cache.463sec:=t.unixSec()
464ifl!=&utcLoc {
465ifl.cacheZone!=nil&&l.cacheStart<=sec&&sec< l.cacheEnd {
466name=l.cacheZone.name467offset=l.cacheZone.offset468 } else {
469name, offset, _, _, _=l.lookup(sec)
470 }
471sec+=int64(offset)
472 } else {
473name="UTC"474 }
475abs=uint64(sec+ (unixToInternal+internalToAbsolute))
476return477 }
What version of Go are you using (go version)?
all go version I have check, go 1.7, 1.8 and go 1.9
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
code review, nothing about the env
What did you do?
code review
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
line 440, if l is nil, should not use l.get().
What did you see instead?
// abs returns the time t as an absolute time, adjusted by the zone offset.
// It is called when computing a presentation property like Month or Hour.
I suggest to be
On 24 Feb 2018, at 17:58, Miancai Li ***@***.***> wrote:
Please answer these questions before submitting your issue. Thanks!
437 func (t Time) abs() uint64 {
438 l := t.loc
439 // Avoid function calls when possible.
440 if l == nil || l == &localLoc {
441 l = l.get()
442 }
443 sec := t.sec + internalToUnix
444 if l != &utcLoc {
445 if l.cacheZone != nil && l.cacheStart <= sec && sec < l.cacheEnd {
446 sec += int64(l.cacheZone.offset)
447 } else {
448 _, offset, _, _, _ := l.lookup(sec)
449 sec += int64(offset)
450 }
451 }
452 return uint64(sec + (unixToInternal + internalToAbsolute))
453 }
What version of Go are you using (go version)?
all go version I have check, go 1.7, 1.8 and go 1.9
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
nothing about th env
What did you do?
code review
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
line 440, if l is nil, should not use l.get().
What did you see instead?
// abs returns the time t as an absolute time, adjusted by the zone offset.
// It is called when computing a presentation property like Month or Hour.
I suggest to be
440 if l != nil && l == &localLoc {
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
#Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?all go version I have check, go 1.7, 1.8 and go 1.9
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?code review, nothing about the env
What did you do?
code review
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
line 440, if l is nil, should not use l.get().
What did you see instead?
// abs returns the time t as an absolute time, adjusted by the zone offset.
// It is called when computing a presentation property like Month or Hour.
I suggest to be
The text was updated successfully, but these errors were encountered: