Skip to content

Commit a41379e

Browse files
committed
note why we need to set the timezone
1 parent 06ad97a commit a41379e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

diff/diff_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ import (
1111
)
1212

1313
func init() {
14+
// Diffs include times that by default are generated in the local
15+
// timezone. To ensure that tests behave the same in all timezones
16+
// (compared to the hard-coded expected output), force the test
17+
// timezone to UTC.
18+
//
19+
// This is safe to do in tests but should not (and need not) be
20+
// done for the main code.
1421
time.Local = time.UTC
1522
}
1623

0 commit comments

Comments
 (0)