The sort package provides functions to sort slices:
import "sort"
numbers := []int{3, 1, 4, 1, 5, 9}
sort.Ints(numbers) // sorts in place
// numbers is now [1, 1, 3, 4, 5, 9]
names := []string{"Bob", "Alice", "Carol"}
sort.Strings(names) // [Alice, Bob, Carol]
Sort modifies the slice in place. It doesn't return a new slice. For custom sorting, you'll implement the sort.Interface.