Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 3283fa8

Browse files
ketsiambakumrombout
authored andcommitted
improve example test by sorting output (cadence-workflow#1366)
* improve example test by sorting output * replace slices pkg with sort * address comments
1 parent cb30dc3 commit 3283fa8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/common/debug/example_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ package debug
2323
import (
2424
"encoding/json"
2525
"fmt"
26+
"sort"
27+
"strings"
2628
"sync"
2729

2830
"go.uber.org/atomic"
@@ -75,6 +77,9 @@ func (ati *activityTrackerImpl) Stats() Activities {
7577
}{Info: a, Count: count})
7678
}
7779
}
80+
sort.Slice(activities, func(i, j int) bool {
81+
return strings.Compare(activities[i].Info.ActivityType, activities[j].Info.ActivityType) < 0
82+
})
7883
return activities
7984
}
8085

0 commit comments

Comments
 (0)