4 ms·
I think it's still there. package main func main() { slice := []string{"first", "second", "third"} println(slice[1]) slice = s
by burntsushi 13y ago
I think it's still there.
package main
func main() {
slice := []string{"first", "second", "third"}
println(slice[1])
slice = slice[0:2]
println(slice[2])
}
Compile with
go build -gcflags -B wat.go
./wat
Output
second
third
Without the `-B` you'll get a runtime panic. I'm on Go 1.1. (Maybe it's removed in tip?)
- pjmlp 13y agoAh ok, I was trying to locate it via the browser. Next time I better checkout and do a proper grep.