We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97e07a4 commit 89aa39bCopy full SHA for 89aa39b
scripts/apitypings/main.go
@@ -8,6 +8,7 @@ import (
8
"log"
9
"os"
10
"path/filepath"
11
+ "sort"
12
"strings"
13
14
"golang.org/x/xerrors"
@@ -69,9 +70,16 @@ func run() error {
69
70
handleValueSpec(s, enums)
71
})
72
73
+ // sort keys so output is always the same
74
+ var keys []string
75
+ for k := range enums {
76
+ keys = append(keys, k)
77
+ }
78
+ sort.Strings(keys)
79
+
80
// write each type alias declaration with possible values
- for _, v := range enums {
- _, _ = fmt.Printf("%s\n", v)
81
+ for _, k := range keys {
82
+ _, _ = fmt.Printf("%s\n", enums[k])
83
}
84
85
return nil
0 commit comments