github.com/weedge/lib@v0.0.0-20230424045628-a36dcc1d90e4/sortx/example_test.go (about) 1 package sortx 2 3 import ( 4 "fmt" 5 "sort" 6 ) 7 8 func ExampleTwoDimensionalArray_Sort() { 9 testCases := [][][]int{ 10 {{1, 1, 1}, {2, 3, 4}, {2, 6, 7}, {3, 4, 5}}, 11 {{1, 1, 1}}, 12 {{1, 1, 1}, {1, 1, 1}}, 13 {{1, 1, 1}, {2, 2, 3}, {2, 3, 3}, {1, 3, 4}}, 14 } 15 16 for _, testCase := range testCases { 17 tc := TwoDimensionalArray(testCase) 18 sort.Sort(tc) 19 fmt.Println(tc) 20 } 21 22 //output: 23 }