Skip to content

Commit

Permalink
use strings.Compare
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoandredinis committed Oct 2, 2024
1 parent f752397 commit 5e20588
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/services/local/user_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"context"
"fmt"
"slices"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -209,13 +210,7 @@ func TestListUserTask(t *testing.T) {
protocmp.Transform(),
}
sortUserTasksFn := func(a *usertasksv1.UserTask, b *usertasksv1.UserTask) int {
if a.Metadata.GetName() < b.Metadata.GetName() {
return 1
}
if a.Metadata.GetName() > b.Metadata.GetName() {
return -1
}
return 0
return strings.Compare(a.Metadata.GetName(), b.Metadata.GetName())
}
counts := []int{0, 1, 5, 10}
for _, count := range counts {
Expand Down

0 comments on commit 5e20588

Please sign in to comment.