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 3, 2024
1 parent ac38fe7 commit 497f0aa
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 @@ -208,13 +209,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 497f0aa

Please sign in to comment.