Skip to content

sort-conversion-without-sort

Default severity: warning

sort.Float64Slice, sort.IntSlice, and sort.StringSlice are types, not sorting functions. Converting a slice to one of these types and assigning it back does not reorder any values.

values = sort.IntSlice(values)
sort.Ints(values)