Update generated code to stable order

This commit is contained in:
Bowei Du
2018-01-09 17:07:22 -08:00
parent e609cda0d2
commit 8cdfe36267
2 changed files with 973 additions and 965 deletions

View File

@@ -28,6 +28,7 @@ import (
"log"
"os"
"os/exec"
"sort"
"text/template"
"time"
@@ -1110,7 +1111,14 @@ func Test{{.Service}}Group(t *testing.T) {
}
`
tmpl := template.Must(template.New("unittest").Parse(text))
for _, s := range meta.AllServicesByGroup {
// Sort keys so the output will be stable.
var keys []string
for k, _ := range meta.AllServicesByGroup {
keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
s := meta.AllServicesByGroup[k]
if err := tmpl.Execute(wr, s); err != nil {
panic(err)
}

File diff suppressed because it is too large Load Diff