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.


Related Resources

Create getters and setters for struct fields
Create getters and setters for struct fields
Generate the support code to access fields indirectly, via getters and setters
Improve Code Readability and Navigation
Improve Code Readability and Navigation
Discover how to manage code visibility with code folding in Go
Create a function in another package
Create a function in another package
Type a non-existing function name and generate its implementation in a package of your choice