Go 1.17: Convert slice to array pointer

With Go 1.17, it is possible to covert a slice to an array pointer

Tip Screenshot

Optimize your code by removing bounds checks when using slices and arrays.

Go 1.17 brings a new language change:

Converting a slice to an array pointer yields a pointer to the underlying array of the slice. If the length of the slice is less than the length of the array, a run-time panic occurs.

Source: Go 1.17 release notes.

New in 2021.2