// main.go package main func main() { var s = []int{1, 2, 3} var pa = (*[2]int)(s[1:]) println(pa[1]) }
$ go run main.go # command-line-arguments ./main.go:6:23: cannot convert s[1:] (type []int) to type *[2]int: conversion of slices to array pointers only supported as of -lang=go1.17 Is it the deliberate design? Shouldn't the lang value be the highest language version supported by the current used toolchain? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/350c23da-a352-4338-9341-cbab16d47f41n%40googlegroups.com.