Y
Hacker News
new
|
ask
|
show
|
jobs
by
neillyons
431 days ago
Golang will panic with a runtime error index out of range if you index out of bounds. There doesn't seem to be a nice built in way to do `arr.get(3)` like in Rust.
slice := []int{1, 2, 3} i := slice[3] fmt.Println(i)