Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
fmt: Println(1 << 31) panics on playground #10437
This is working as intended. The Go spec says that the default type for integer constant expressions is "int", which on the Go playground is a 32-bit type and is unable to exactly represent the constant 1<<31. The compiler isn't picking a wider type because the spec doesn't allow it to.