]> Cypherpunks repositories - gostls13.git/commit
time: fix AddDate with nil location
authorSimon Rawet <simon@rawet.se>
Sat, 28 May 2016 14:46:45 +0000 (16:46 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 6 Oct 2016 18:41:23 +0000 (18:41 +0000)
commitb4f3c9339e77e70cbd5b81ef7f2a4dec557d40de
tree1716659dc17c2e129a28bb22a1d1e4f6c26ea681
parentc79ba22ece2cbb86b00325df7712ff0803cfd6e9
time: fix AddDate with nil location

AddDate now retrieves location from t.Location() to ensure that
it never calls Date with a nil location.

Added test for this bug on all Time's methods

Fixes #15852

Change-Id: Id2a222af56993f741ad0b802a2c3b89e8e463926
Reviewed-on: https://go-review.googlesource.com/23561
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
src/time/time.go
src/time/time_test.go