我正在try 对围棋中的一片整数进行反向排序.
example := []int{1,25,3,5,4}
sort.Ints(example) // this will give me a slice sorted from 1 to the highest number
如何对其进行排序,使其从最高到最低?所以[25 5 4 3 1]
我试过这个
sort.Sort(sort.Reverse(sort.Ints(keys)))
来源:http://golang.org/pkg/sort/#Reverse
然而,我得到了下面的错误
# command-line-arguments
./Roman_Numerals.go:31: sort.Ints(keys) used as value