Go

Go

Made by DeepSource

Use sort.Ints(x), sort.Float64s(x), and sort.Strings(x) SCC-S1032

Anti-pattern
Major
Autofix

The sort.Ints, sort.Float64s and sort.Strings functions are shorthands and are easier to read than sort.Sort(sort.IntSlice(x)), sort.Sort(sort.Float64Slice(x)) and sort.Sort(sort.StringSlice(x)) respectively.

Bad practice

sort.Sort(sort.StringSlice(x))

Recommended

sort.Strings(x)

References