I would like to build a function that returns a slice of any size. I know I can do
func BuildSlice() [100]int { return [100]int{} }
but I would like to be able to return slices of different sizes from the same function. Something like:
func BuildSlice(int size) [...]int { return [size]int{} }
I've tried the above as well as
func BuildSlice(size int) []int { return [size]int{} }
Please point me in the right direction.
Thanks.