fix(genapi): Sort slice in removeDups template function (#1889)

The removeDups template function converts a slice into a map and
back into a slice in order to leverage the map keys to remove
duplicates. However, since the iteration order over a map is not
specified it would be possible to get different orders for multiple runs
of `make api`. While this would not have an impact on any functionality,
it is causing sporadic failures for the new make-gen-deltas CI job.

See: https://go.dev/ref/spec#For_statements
Ref: d57603022a
add-desktop-vault-credential-clickthrough
Timothy Messier 4 years ago committed by GitHub
parent be75a2cd3c
commit bdb98d508e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -816,5 +816,8 @@ func removeDups(in []string) []string {
for val := range vals {
ret = append(ret, val)
}
sort.Strings(ret)
return ret
}

Loading…
Cancel
Save