Skip to content

Commit 3c345e8

Browse files
committed
fixup! chore: update golang.org/x/exp/slices
1 parent ea37bc6 commit 3c345e8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

coderd/users_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import (
44
"context"
55
"fmt"
66
"net/http"
7-
"sort"
87
"strings"
98
"testing"
109
"time"
1110

1211
"github.com/google/uuid"
1312
"github.com/stretchr/testify/assert"
1413
"github.com/stretchr/testify/require"
14+
"golang.org/x/exp/slices"
1515
"golang.org/x/sync/errgroup"
1616

1717
"github.com/coder/coder/cli/clibase"
@@ -20,6 +20,7 @@ import (
2020
"github.com/coder/coder/coderd/database"
2121
"github.com/coder/coder/coderd/database/dbauthz"
2222
"github.com/coder/coder/coderd/rbac"
23+
"github.com/coder/coder/coderd/util/slice"
2324
"github.com/coder/coder/codersdk"
2425
"github.com/coder/coder/testutil"
2526
)
@@ -1804,8 +1805,8 @@ func assertPagination(ctx context.Context, t *testing.T, client *codersdk.Client
18041805

18051806
// sortUsers sorts by (created_at, id)
18061807
func sortUsers(users []codersdk.User) {
1807-
sort.Slice(users, func(i, j int) bool {
1808-
return strings.ToLower(users[i].Username) < strings.ToLower(users[j].Username)
1808+
slices.SortFunc(users, func(a, b codersdk.User) int {
1809+
return slice.Ascending(strings.ToLower(a.Username), strings.ToLower(b.Username))
18091810
})
18101811
}
18111812

0 commit comments

Comments
 (0)