Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: