Skip to content

Commit 83a0efb

Browse files
perdasilvaPer Goncalves da Silva
andauthored
Add key ordering for mermaid graph output (#1778)
Signed-off-by: Per Goncalves da Silva <[email protected]> Co-authored-by: Per Goncalves da Silva <[email protected]>
1 parent 1d97b7f commit 83a0efb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

alpha/declcfg/write.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"fmt"
77
"io"
8+
"maps"
89
"os"
910
"path/filepath"
1011
"slices"
@@ -270,7 +271,8 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer)
270271
}
271272

272273
// express the decoration classes
273-
for key := range decoratedBundleIDs {
274+
sortedKeys := slices.Sorted(maps.Keys(decoratedBundleIDs))
275+
for _, key := range sortedKeys {
274276
if len(decoratedBundleIDs[key]) > 0 {
275277
b := slices.Clone(decoratedBundleIDs[key])
276278
slices.Sort(b)

0 commit comments

Comments
 (0)