Skip to content

Instantly share code, notes, and snippets.

@joekir
Created September 5, 2017 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joekir/177f2a25ebd6a7c5026bf4cc6836c309 to your computer and use it in GitHub Desktop.
Save joekir/177f2a25ebd6a7c5026bf4cc6836c309 to your computer and use it in GitHub Desktop.
Weird differences in behaviours
package main
import "fmt"
func main() {
const big int = 0x7FFFFFFF/2
s := [big]int{3}
fmt.Println(s[big-1])
}
package main
import "fmt"
func main() {
const big int = 0x7FFFFFFF/2
s := [big]int{}
fmt.Println(s[big-1])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment