---
title: "sort-non-slice"
description: "Detect sort.Slice calls with non-slice values."
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-non-slice

**Default severity:** `error`

`sort.Slice`, `sort.SliceStable`, and `sort.SliceIsSorted` accept `any` only
for historical API reasons. The value must hold a slice; passing an array or
another concrete type panics at runtime.

## Bad

```go
sort.Slice(array, less)
```

## Good

```go
sort.Slice(values, less)
```

Source: https://strider.gempir.com/analyzers/sort-non-slice/index.mdx
