I’m sure it’s been asked umpteen times before but I feel I must be missing something.
I’m trying to use writeAll, which expects a 2D slice of strings.
Unfortunately, my object is a 2D array. I tried to cast it to a slice with M[:][:] but the second dimension is still an array: cannot use m[:][:] (type [][12]string) as type [][]string in argument to w.WriteAll
Is there some syntactic sugar I can try to make it work? I’d rather avoid building a slice just for that.
Thank you for the reply but that’s what I wanted to avoid. If it were a 1D array, using [:] would turn it into a slice without any helper function. I’m wondering if there’s a way to that for a 2D array, without resorting to explicitly building and populating a 2D slice.