test(package): clarify comment on Time.Equal usage in tar modtime check

Signed-off-by: Ilya Kiselev <kis-ilya-a@yandex.ru>
pull/32173/head
Ilya Kiselev 4 months ago
parent 99054cc23c
commit f6abb7c2ac

@ -197,8 +197,9 @@ func TestRunWithSourceDateEpoch(t *testing.T) {
require.True(t, gr.ModTime.IsZero(), "gzip header ModTime should be zero") require.True(t, gr.ModTime.IsZero(), "gzip header ModTime should be zero")
defer gr.Close() defer gr.Close()
// All tar entry ModTimes must represent the same instant as epoch. // Use Equal() rather than require.Equal so that timezone differences between
// tar.Reader returns ModTime in local timezone, so use Equal() not require.Equal. // the stored epoch (UTC) and the value tar.Reader reconstructs do not cause
// a false failure on non-UTC machines.
tr := tar.NewReader(gr) tr := tar.NewReader(gr)
for { for {
hdr, err := tr.Next() hdr, err := tr.Next()

Loading…
Cancel
Save