1
0
Fork 0

Reproducible Builds: Sort protoList before marshal (#605)

pull/607/head
kpcyrd 4 years ago committed by GitHub
parent dc8b361354
commit 6ccee886e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,6 +8,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"sort"
"strconv"
"strings"
@ -372,6 +373,11 @@ func main() {
}
}
// Sort protoList so the marshaled list is reproducible
sort.SliceStable(protoList.Entry, func(i, j int) bool {
return protoList.Entry[i].CountryCode < protoList.Entry[j].CountryCode
})
protoBytes, err := proto.Marshal(protoList)
if err != nil {
fmt.Println("Failed:", err)

Loading…
Cancel
Save