selecting 2D sub-slice of a 2D-slice using ranges in go
问题 I'm getting a surprising result when selecting a 2D sub-slice of a slice. Consider the following 2D int array a := [][]int{ {0, 1, 2, 3}, {1, 2, 3, 4}, {2, 3, 4, 5}, {3, 4, 5, 6}, } To select the top left 3x3 2D slice using ranges I would use b := a[0:2][0:2] I would expect the result to be [[0 1 2] [1 2 3] [2 3 4]] however the second index range doesn't seem to have any effect, and returns the following instead: [[0 1 2 3] [1 2 3 4] [2 3 4 5]] What am I missing? Can you simply not select a