I have a slice of int32 that wants to convert to slice of int in Golang. I can convert it by iterating all values and changing the type then append it to a new int slice but I want to do it more optimized. Is there any way or function to do it?
For example :
var a []int32{1,2,3,4}
How can a convert a type from []int32 to []int?