偶然需要用到的时候百度了很久没有找到,最后还是谷歌到了···贴上链接 https://www.geeksforgeeks.org/how-to-sort-a-slice-stable-in-golang/ 代码 type Word struct { str string len int } type Words []Word func main() { var words Words sort.SliceStab