Skip to content

Commit

Permalink
improve example test by sorting output (#1366)
Browse files Browse the repository at this point in the history
* improve example test by sorting output

* replace slices pkg with sort

* address comments
  • Loading branch information
ketsiambaku authored Sep 10, 2024
1 parent fd9956a commit 74f6915
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/common/debug/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ package debug
import (
"encoding/json"
"fmt"
"sort"
"strings"
"sync"

"go.uber.org/atomic"
Expand Down Expand Up @@ -75,6 +77,9 @@ func (ati *activityTrackerImpl) Stats() Activities {
}{Info: a, Count: count})
}
}
sort.Slice(activities, func(i, j int) bool {
return strings.Compare(activities[i].Info.ActivityType, activities[j].Info.ActivityType) < 0
})
return activities
}

Expand Down

0 comments on commit 74f6915

Please sign in to comment.