Go’s sort package implements sorting for builtins
and user-defined types. We’ll look at sorting for
builtins first.
packagemain
import("fmt""sort")
funcmain(){
Sort methods are specific to the builtin type;
here’s an example for strings. Note that sorting is
in-place, so it changes the given slice and doesn’t
return a new one.