---
title: "sort-conversion-without-sort"
description: "Detect slice type conversions mistaken for sorting calls."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

## Bad

```go
values = sort.IntSlice(values)
```

## Good

```go
sort.Ints(values)
```

Source: https://strider.gempir.com/analyzers/sort-conversion-without-sort/index.mdx
