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.17 darwin/amd64
Yes.
go env
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Users/bmizerany/Library/Caches/go-build" GOENV="/Users/bmizerany/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/bmizerany/go/pkg/mod" GONOPROXY="github.com/bmizerany" GONOSUMDB="github.com/bmizerany" GOOS="darwin" GOPATH="/Users/bmizerany/go" GOPRIVATE="github.com/bmizerany" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.17" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/usr/local/go/src/go.mod" 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/rf/6fdgwbmj2rxf1jw13q4fv7h80000gn/T/go-build613577533=/tmp/go-build -gno-record-gcc-switches -fno-common" GOROOT/bin/go version: go version go1.17 darwin/amd64 GOROOT/bin/go tool compile -V: compile version go1.17 uname -v: Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 ProductName: macOS ProductVersion: 11.5.2 BuildVersion: 20G95 lldb --version: lldb-1205.0.28.2 Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)
Attempted to print math.MaxUint64 with fmt.Println
math.MaxUint64
fmt.Println
See: https://play.golang.org/p/N4Aj1AsylRp
I see the same locally on my M1:
/tmp % cat x.go ───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── │ File: x.go ───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 1 │ package main 2 │ 3 │ import ( 4 │ "fmt" 5 │ "math" 6 │ ) 7 │ 8 │ func main() { 9 │ x := uint64(math.MaxUint64) 10 │ fmt.Println(x) 11 │ 12 │ fmt.Println(math.MaxUint64) 13 │ } ───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── /tmp % go run x.go # command-line-arguments ./x.go:12:13: constant 18446744073709551615 overflows int
The maximum value of an uint64 without an error.
This error: ./prog.go:12:13: constant 18446744073709551615 overflows int
./prog.go:12:13: constant 18446744073709551615 overflows int
The text was updated successfully, but these errors were encountered:
Nevermind. I see the error in my ways: Println doesn't instinctively convert the number to a uint64. Please ignore.
Sorry, something went wrong.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Attempted to print
math.MaxUint64
withfmt.Println
See: https://play.golang.org/p/N4Aj1AsylRp
I see the same locally on my M1:
What did you expect to see?
The maximum value of an uint64 without an error.
What did you see instead?
This error:
./prog.go:12:13: constant 18446744073709551615 overflows int
The text was updated successfully, but these errors were encountered: