Skip to content

Commit

Permalink
Merge #60704
Browse files Browse the repository at this point in the history
60704: timeutil: sort timezones r=otan a=mneverov

Previously, timezones in the generated file were not sorted. That led to
the file being changed greatly when Go version was updated, or even
within the same Go version when /usr/local/go/lib/time/zoneinfo.zip was
regenerated from different time zone releases:
https://data.iana.org/time-zones/releases
This patch sorts timezones before writing them down so the changes in
the file are minimal and only reflect the actual change in the
timezones.

Release note: None

Co-authored-by: Max Neverov <neverov.max@gmail.com>
  • Loading branch information
craig[bot] and mneverov committed Feb 18, 2021
2 parents 86a44f7 + 64ac1cc commit c76fe62
Show file tree
Hide file tree
Showing 2 changed files with 435 additions and 433 deletions.
2 changes: 2 additions & 0 deletions pkg/util/timeutil/generate_lowercase_timezones.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"os/exec"
"path/filepath"
"runtime"
"sort"
"strings"

"github.com/cockroachdb/errors"
Expand Down Expand Up @@ -70,6 +71,7 @@ func main() {
if err != nil {
log.Fatalf("error parsing tzdata: %+v", err)
}
sort.Strings(zones)

of, err := os.Create(fileName)
if err != nil {
Expand Down
Loading

0 comments on commit c76fe62

Please sign in to comment.