Go Cheatsheet - Sort
Sort
Sort Ints
ints := []int{3, 1, 4, 5, 2}
sort.Ints(ints)
// [1 2 3 4 5]
Sort String
strs := []string{"bob", "clair", "alice"}
sort.Strings(strs)
// [alice bob clair]
Sort in Reverse Order
ints := []int{3, 1, 4, 5, 2}
sort.Sort(sort.Reverse(sort....
hn.0xbf.me2 min read