Skip to content

Commit 1e7fa73

Browse files
author
Sébastien HOUZÉ
committed
refactor: replace setModTime by Modified
1 parent f60de5b commit 1e7fa73

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/provider/zip_archiver.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ func (a *ZipArchiver) ArchiveFile(infilename string) error {
6060
fh.Name = filepath.ToSlash(fi.Name())
6161
fh.Method = zip.Deflate
6262
oldestZipSupportedModTime, _ := time.Parse(time.RFC3339, "1980-01-01T00:00:00+00:00")
63-
// fh.Modified alone isn't enough when using a zero value
64-
fh.SetModTime(oldestZipSupportedModTime)
63+
fh.Modified = oldestZipSupportedModTime
6564

6665
f, err := a.writer.CreateHeader(fh)
6766
if err != nil {
@@ -136,8 +135,7 @@ func (a *ZipArchiver) ArchiveDir(indirname string, excludes []string) error {
136135
fh.Name = filepath.ToSlash(relname)
137136
fh.Method = zip.Deflate
138137
oldestZipSupportedModTime, _ := time.Parse(time.RFC3339, "1980-01-01T00:00:00+00:00")
139-
// fh.Modified alone isn't enough when using a zero value
140-
fh.SetModTime(oldestZipSupportedModTime)
138+
fh.Modified = oldestZipSupportedModTime
141139

142140
f, err := a.writer.CreateHeader(fh)
143141
if err != nil {

0 commit comments

Comments
 (0)