Reproducible Builds: Sort protoList before marshal (#605)
This commit is contained in:
parent
dc8b361354
commit
6ccee886e3
6
main.go
6
main.go
@ -8,6 +8,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"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)
|
protoBytes, err := proto.Marshal(protoList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed:", err)
|
fmt.Println("Failed:", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user