commit | 17d7983b29ba633708a9d7b18f90ab5bc029502d | [log] [tgz] |
---|---|---|
author | Russ Cox <rsc@golang.org> | Mon Apr 25 14:06:10 2022 -0400 |
committer | Gopher Robot <gobot@golang.org> | Tue Apr 26 02:28:58 2022 +0000 |
tree | 37a2799a2c7955a770fa5eb73435f031b6a863a3 | |
parent | 09ada1af8f54584e46deb0d643713393a9d83b10 [diff] |
time: fix quickcheck test to avoid wraparounds When we call time.Unix(s, ns), the internal representation is s + 62135596800, where 62135596800 is the number of seconds from Jan 1 1 to Jan 1 1970. If quickcheck generates numbers too close to 2^63, the addition can wraparound to make a very negative internal 64-bit value. Wraparounds are not guarded against, since they would not arise in any reasonable program, so just avoid testing near them. Fixes #52409. Change-Id: Id466c8a34a49055ab26f2687a6b2b657cb64bed6 Reviewed-on: https://go-review.googlesource.com/c/go/+/402177 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.