Skip to content

Commit

Permalink
fixed markdown order shuffling every run
Browse files Browse the repository at this point in the history
  • Loading branch information
oribon committed Dec 22, 2020
1 parent 4d38c36 commit d7912a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cnf-tests/docgen/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ func descriptionsToList(descriptions map[string]string, matcher func(string) boo
if !matcher(n) {
continue
}
i := sort.Search(len(res), func(i int) bool { return res[i].Name >= n })
sanitizedName := sanitizeName(n)
i := sort.Search(len(res), func(i int) bool { return res[i].Name >= sanitizedName })
res = append(res, TestDescription{})
copy(res[i+1:], res[i:])
res[i] = TestDescription{sanitizeName(n), d}
res[i] = TestDescription{sanitizedName, d}
}
return res
}
Expand Down

0 comments on commit d7912a4

Please sign in to comment.