The only error in the first part is that you forgot the : after enemys. The same type works fine in the function as well. If you want to type-erase the lengths of the arrays, then that's going to be messier. The standard library doesn't provide any way to deal with nested slices like that.