diff options
author | Alejandro Rodríguez <alejorro70@gmail.com> | 2017-09-22 04:07:54 +0300 |
---|---|---|
committer | Alejandro Rodríguez <alejorro70@gmail.com> | 2017-09-22 04:07:54 +0300 |
commit | c528e9f75fa39bc7b745386c597d636bcab4d6cc (patch) | |
tree | e62a7ad508146b655a4c3005a257883d55e16745 /internal/git | |
parent | f0f1ea597cf605e511a4064a3a07dd20fae5aab2 (diff) |
Change invalid date value var name to a more apt one
Diffstat (limited to 'internal/git')
-rw-r--r-- | internal/git/helper.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/git/helper.go b/internal/git/helper.go index 2a1443316..dc755f437 100644 --- a/internal/git/helper.go +++ b/internal/git/helper.go @@ -9,8 +9,10 @@ import ( pb "gitlab.com/gitlab-org/gitaly-proto/go" ) -// Maximum time value possible. See https://stackoverflow.com/a/32620397 -var maxTimeValue = time.Unix(1<<63-62135596801, 999999999) +// FallbackTimeValue is the value returned by `SafeTimeParse` in case it +// encounters a parse error. It's the maximum time value possible in golang. +// See https://gitlab.com/gitlab-org/gitaly/issues/556#note_40289573 +var FallbackTimeValue = time.Unix(1<<63-62135596801, 999999999) // ValidateRevision checks if a revision looks valid func ValidateRevision(revision []byte) error { @@ -30,7 +32,7 @@ func ValidateRevision(revision []byte) error { func SafeTimeParse(timeStr string) time.Time { t, err := time.Parse(time.RFC3339, timeStr) if err != nil { - return maxTimeValue + return FallbackTimeValue } return t |