See “Slices: usage and internals”
var av = []int{1,5,2,3,7}
That is a slice, not an array.
A slice literal is declared just like an array literal, except you leave out the element count.
That explains why the sort function will modify the content of what is referenced by the slice.
As commented below by Kirk, sort.Ints
will give you an error if you passed it an array instead of a slice.
func Ints(a []int)