top of page
Golang
Speaker's Corner
Your Name and Surname
The most basic optimization of the Go code that uses slices is to pre-allocation memory for the expected amount of elements. How to pre-allocate an empty []string slice for 1000 elements?
*
[1000]string{}
make([]string, 0, 1000)
new([]string, 0, 1000)
I am informed about processing of my personal data and the right to withdraw my consent
Submit
© 2024 by Ciklum. All rights reserved.
Ciklum Privacy Notice
bottom of page