We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version
$ go version go version go1.18 darwin/amd64
Haven't tested.
go env
$ go env GO111MODULE="auto" GOARCH="amd64" GOBIN="/Users/user/go/bin" GOCACHE="/Users/user/Library/Caches/go-build" GOENV="/Users/user/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/user/go/pkg/mod" GONOPROXY="github.com/company/*" GONOSUMDB="github.com/company/*" GOOS="darwin" GOPATH="/Users/user/go" GOPRIVATE="github.com/company/*" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/Cellar/go/1.18/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.18/libexec/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.18" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/43/tj8j9j210w90_qk38fv70gs80000gp/T/go-build119987376=/tmp/go-build -gno-record-gcc-switches -fno-common"
I ran this.
package main import ( "fmt" "math" "time" ) func main() { updatedAt := time.Unix(math.MaxInt64, 0) fmt.Println(updatedAt) fmt.Println(time.Since(updatedAt)) updatedAt = time.Unix(922337203685477580, 0) fmt.Println(time.Since(updatedAt)) }
I expect to see the output of time.Since(maxInt64) as a negative value.
It returns a positive value.
292277026596-12-04 15:30:07 +0000 UTC 2562047h47m16.854775807s -2562047h47m16.854775808s
The text was updated successfully, but these errors were encountered:
Duplicate of #6210 and #10906.
Sorry, something went wrong.
Duplicate of #10906
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Haven't tested.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I ran this.
What did you expect to see?
I expect to see the output of time.Since(maxInt64) as a negative value.
What did you see instead?
It returns a positive value.
The text was updated successfully, but these errors were encountered: